Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ ENV DOCKER_USER=baserow_docker_user \
DJANGO_SETTINGS_MODULE='baserow.config.settings.test'

RUN groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow

COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
Expand Down Expand Up @@ -266,6 +267,7 @@ ENV DOCKER_USER=baserow_docker_user \

RUN getent group $GID || groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow && \
echo "${DOCKER_USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${DOCKER_USER} && \
chmod 0440 /etc/sudoers.d/${DOCKER_USER}

Expand Down Expand Up @@ -350,7 +352,8 @@ RUN apt-get update && \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow

# In slim docker images, mime.types is removed and we need it for mimetypes guessing
COPY ./backend/docker/mime.types /etc/
Expand Down
3 changes: 1 addition & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ dependencies = [
"tzdata==2025.3",
"sentry-sdk==2.52.0",
"typing_extensions>=4.14.1",
"ollama==0.6.1",
"langchain==0.3.27",
"langchain==0.3.28",
"langchain-openai==0.3.35",
"openai==2.14.0",
"anthropic==0.77.0",
Expand Down
44 changes: 13 additions & 31 deletions backend/src/baserow/core/generative_ai/generative_ai_model_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def prompt(
raise GenerativeAIPromptError(str(exc)) from exc


class OllamaGenerativeAIModelType(GenerativeAIModelType):
class OllamaGenerativeAIModelType(BaseOpenAIGenerativeAIModelType):
type = "ollama"

def get_host(self, workspace=None, settings_override=None):
Expand All @@ -339,46 +339,28 @@ def get_host(self, workspace=None, settings_override=None):
or settings.BASEROW_OLLAMA_HOST
)

def get_api_key(self, workspace=None, settings_override=None):
return "ollama"

def get_organization(self, workspace=None, settings_override=None):
return None

def get_base_url(self, workspace=None, settings_override=None):
host = self.get_host(workspace, settings_override)
return f"{host}/v1"

def get_enabled_models(self, workspace=None, settings_override=None):
workspace_models = self.get_workspace_setting(
workspace, "models", settings_override
)
return workspace_models or settings.BASEROW_OLLAMA_MODELS

def is_enabled(self, workspace=None, settings_override=None):
ollama_host = self.get_host(workspace, settings_override)
return bool(ollama_host) and bool(
host = self.get_host(workspace, settings_override)
return bool(host) and bool(
self.get_enabled_models(workspace, settings_override)
)

def get_client(self, workspace=None, settings_override=None):
from ollama import Client as OllamaClient

ollama_host = self.get_host(workspace, settings_override)
return OllamaClient(host=ollama_host)

def prompt(
self, model, prompt, workspace=None, temperature=None, settings_override=None
):
from ollama import RequestError as OllamaRequestError
from ollama import ResponseError as OllamaResponseError

client = self.get_client(workspace, settings_override)
options = {}
if temperature:
# Because some LLMs can have a temperature of 2, this is the maximum by
# default. We're changing it to a maximum of 1 because Ollama only
# accepts 1.
options["temperature"] = min(temperature, 1)
try:
response = client.generate(
model=model, prompt=prompt, stream=False, options=options
)
except (OllamaRequestError, OllamaResponseError) as exc:
raise GenerativeAIPromptError(str(exc)) from exc

return response["response"]

def get_settings_serializer(self):
from baserow.api.generative_ai.serializers import OllamaSettingsSerializer

Expand Down
25 changes: 4 additions & 21 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Remove ollama dependency",
"issue_origin": "github",
"issue_number": 4962,
"domain": "database",
"bullet_points": [],
"created_at": "2026-03-12"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Fix a bug that caused an error when running the backend and frontend images as different users.",
"issue_origin": "github",
"issue_number": null,
"domain": "core",
"bullet_points": [],
"created_at": "2026-03-12"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "refactor",
"message": "Update langchain to 0.3.28",
"issue_origin": "github",
"issue_number": 4965,
"domain": "database",
"bullet_points": [],
"created_at": "2026-03-12"
}
7 changes: 5 additions & 2 deletions web-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ ENV DOCKER_USER=baserow_docker_user \
BASEROW_IMAGE_TYPE="web-frontend"

RUN groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow

COPY --from=tool-builder /usr/local/bin/su-exec /usr/local/bin/su-exec
COPY --from=tool-builder /usr/bin/tini /usr/bin/tini
Expand Down Expand Up @@ -193,6 +194,7 @@ COPY --from=tool-builder /usr/bin/dos2unix /usr/local/bin/dos2unix

RUN getent group $GID || groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow && \
echo "${DOCKER_USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${DOCKER_USER} && \
chmod 0440 /etc/sudoers.d/${DOCKER_USER}

Expand Down Expand Up @@ -267,7 +269,8 @@ RUN apt-get update && apt-get upgrade -y --no-install-recommends \
RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx

RUN groupadd --system --gid $GID ${DOCKER_USER} && \
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER}
useradd --shell /bin/bash -l -u $UID -g $GID -o -c "" -d /baserow -m ${DOCKER_USER} && \
chmod 755 /baserow

USER $UID:$GID
RUN mkdir -p /baserow/web-frontend/docker
Expand Down
Loading