Skip to main content

DigitalBase API

FastAPI backend of DigitalBase (internal name: lmlight). Single source tree — the inference backend is chosen at runtime with LLM_BACKEND=ollama|vllm|sglang|none (vllm / sglang spawn and supervise their own chat/embed/vision servers via common/llm/local_engine.py; none = cloud LLM APIs only). Shipped to customers as a PyInstaller single binary built by .github/workflows/release.yml.

Run from source

cd api
uv sync                      # deps + dev group (pytest, ruff, cython, ...)
# write api/.env (python-dotenv): DATABASE_URL, JWT_SECRET, LLM_BACKEND, ... (all keys: common/config/)
uv run python main.py        # listens on API_HOST:API_PORT (default 0.0.0.0:8000)
uv run python manage.py db diff   # show pending schema ALTERs (see ../docs/migrations.md)

PostgreSQL with pgvector is required for knowledge (RAG) (DATABASE_URL). Startup creates schemas, tables and the vector extension itself; the database must already exist. Without the extension the API still starts with RAG disabled, and an admin enables it from License > RAG search enhancement once a superuser has run CREATE EXTENSION vector (see ../docs/migrations.md). The SPA build in static/ is served by the same process when present.

Layout

Dir Role
main.py app assembly: lifespan (DB migration, local engine start), router registration, SPA static files
auth/, user/, admin/, system/, system_settings/ login/JWT/LDAP/OIDC, user settings, admin console (users/models/license/env/audit), health/license
chat/ chat orchestration (NDJSON stream, tool loop, approvals, history, compaction, prompt suggest)
rag/ bots, documents, ingest jobs (/api/bots, /api/documents, /api/upload)
sql/, table/, files/ SQL connections + datalake + dashboards, table editing engine, file storage with shared-dir ACL (files/virtual_path.py = the user_id-based virtual path resolver operators and tools share)
operators/ execution units shared by workflows, chat tools and MCP: flow/transform/ai/files/data/saas/fa/actions (@register, ExecutionContext)
pipeline/ workflow engine: graph, scheduler, runs, webhooks, AI flow editing (runs operators/)
connections/ API connection (SaaS credential) CRUD; SQL / file / OAuth connections live in sql/ files/ oauth/
mcp_servers/, oauth/, approvals/, prompts/, history_share/, transcribe/, benchmark/ managed custom MCP servers, OAuth connectors, tool approvals, prompt library, history sharing, whisper, benchmark
gateway/ /v1/* OpenAI/Anthropic-compatible API and /mcp server for sk- API keys
common/ cross-cutting code: config/, db/ (models + startup migrations), llm/ (all LLM I/O over httpx, invoke.py = one-shot call helper), rag/ (lifecycle.py = document / chunk deletion shared by upload and workflows), sql/, tools/ (tool handlers, permissions, MCP), connectors/ (HTTP retry / templating core), document/, file_connector/ (snapshot.py = file_landed diff ledger), runtime/
tests/ unit/ + contract/ (no external deps), e2e/ + connection/ (need E2E_BASE), see tests/README.md

Conventions (short list)

  • Function-first Python; classes only for state / inheritance / library requirements. One-line Japanese comments.
  • LLM HTTP goes through common/llm (httpx, auth_headers()), never an SDK. Chat uses /v1/chat/completions only.
  • New module → import it explicitly in the package __init__.py and add a --hidden-import in release.yml (tests/contract/test_packaging.py enforces this; Cython-compiled modules are invisible to PyInstaller).
  • Tunable constants live in common/config via get_env(..., advanced=True); API datetimes use iso_utc().
  • Document text comes only from common.document.extract_document (chat attachments, tools, RAG, pipelines); callers never import parsers or branch on format (tests/contract/test_document_extraction_boundary.py).
  • Full principles: ../docs/CODING_PRINCIPLES.md.

Tests

Single entry point is the repo-root ./test.sh (layer definitions: ../docs/test/MATRIX.md).

../test.sh unit          # api unit+contract + app vitest (no external deps)
../test.sh api           # api unit+contract only
../test.sh integration   # tests/e2e against E2E_BASE (default http://localhost:8000); add `fast` to skip @llm
../test.sh connection    # tests/connection (mocks: ../test.sh env up demo)
../test.sh smoke         # GET sweep of every route on a running instance
uv run ruff check .      # lint / format (ruff format)

Release gate (release.yml) runs only tests/contract/test_packaging.py plus the app tsc / vite build; everything else is run manually before tagging.

Metadata

Release files for digitalbase 26.917.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for digitalbase 26.917.2
File
digitalbase-26.917.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
digitalbase-26.917.2-cp313-cp313-manylinux_2_39_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.39+ x86-64 Details
digitalbase-26.917.2-cp313-cp313-manylinux_2_39_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.39+ ARM64 Details
digitalbase-26.917.2-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details

Total release size: 104.1 MB

Release files / digitalbase-26.917.2-cp313-cp313-win_amd64.whl

Download URL digitalbase-26.917.2-cp313-cp313-win_amd64.whl
Size 18.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
a9f2b288b290bbdb2c86ee9082d349ae2475cb3cb3114074bcb85c6691501678
BLAKE2b-256 checksum
How to use checksums
83c4980cbc17e51cd409960edfcef58035cde75d7d373b0406c1486ee5fa2888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / digitalbase-26.917.2-cp313-cp313-manylinux_2_39_x86_64.whl

Download URL digitalbase-26.917.2-cp313-cp313-manylinux_2_39_x86_64.whl
Size 25.0 MB
Tags CPython 3.13 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
b8f2c4b36905576375e6ddf657373785ae87fcbcdc048dfc6967677b70020bc0
BLAKE2b-256 checksum
How to use checksums
d36605e096a760769a02ec722047c1d810428103b3f07e79930a4fc2a64e8109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / digitalbase-26.917.2-cp313-cp313-manylinux_2_39_aarch64.whl

Download URL digitalbase-26.917.2-cp313-cp313-manylinux_2_39_aarch64.whl
Size 22.9 MB
Tags CPython 3.13 Linux glibc 2.39+ ARM64
SHA-256 checksum
How to use checksums
be90eb586119e0d496cc2f233f3cf9c96a7c2e8bcee845a328f8e8902e43f089
BLAKE2b-256 checksum
How to use checksums
01a8bbf12303206853d0b554fc897fe02cf491bab551e532da8705f80dfa47ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / digitalbase-26.917.2-cp313-cp313-macosx_15_0_arm64.whl

Download URL digitalbase-26.917.2-cp313-cp313-macosx_15_0_arm64.whl
Size 37.4 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
0f751b358ca902391878ab962e2f49a956c810049bf8231d1b0086055da67051
BLAKE2b-256 checksum
How to use checksums
040aabbf9d4388a588a4c8cd5e4c075dfa65ea9fb24419409badd6ff8f744d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

26.923

4 release files

This release

26.917.2 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page