Commit graph

18 commits

Author SHA1 Message Date
ca79a39eef opensearch dot volume 2026-11-23 22:42:08 +01:00
0c507ebfea Traefik Allowlist V2 2026-11-20 21:19:47 +01:00
7506695e7d Traefik IP Allowlist 2026-11-20 20:39:57 +01:00
64189e6140 Support a prebuilt web image (build once, pull on each instance)
Parameterize the web_server image + pull policy so an instance can pull a
centrally-built image from a private registry instead of running the
~16 GB `make build` locally:

  image:       ${AIDO_WEB_IMAGE:-livtec/aido-web:local}
  pull_policy: ${AIDO_WEB_PULL_POLICY:-never}

Defaults keep the current local-build behaviour, so build hosts and local
dev are unaffected. Add docs/PREBUILT-IMAGE.md with the build-once /
push-to-private-registry / pull-everywhere workflow.
2026-11-19 19:47:51 +01:00
cfb3b7d418 fix(voice): route Onyx 5.0.3 STT/TTS to LocalAI Whisper endpoint
Replace the broken sed-based entrypoint from 4.8.2 with a runtime Python
patch script for Onyx 5.0.3 voice module compatibility.

Background
----------
Onyx 5.0.3 refactored the voice subsystem to use raw aiohttp instead of
the OpenAI Python SDK. The old /v1 suffix in our LocalAI base URL now
causes a double-prefix (https://.../v1/v1/audio/...) and 404s.
Additionally, line numbers and constants shifted, making the previous
sed patches fail silently.

Changes
-------
* api_server: override CMD with a startup sequence that runs
  patch_voice.py before uvicorn.
* Add backend/scripts/patch_voice.py that patches:
  - factory.py: fallback api_base, stt_model and api_key when no
    voice provider is configured in the Onyx admin UI.
  - providers/openai.py: DEFAULT_OPENAI_API_BASE (without /v1),
    realtime model constants, and optional chunked-STT language
    injection (WHISPER_LANGUAGE=de).
* Mount patch script read-only into /app/scripts/.
* Env: WHISPER_API_BASE now points to the origin only
  (https://aido-whisper-ch.livtec.cloud), leaving /v1 path assembly
  to Onyx code.
* Env: WHISPER_MODEL=whisper-1, WHISPER_LANGUAGE=de.

Migration
---------
The previous entrypoint sed block is removed. No admin UI voice
provider configuration is required; the patch is fully transparent.

Refs: aido-whisper-ch deployment, Onyx 5.0.3 upgrade
2026-11-12 20:10:14 +01:00
806d3b2160 Revert "fix(api_server): update voice STT patch for Onyx 5.0.3 image layout"
This reverts commit f51a35732c.
2026-11-12 20:04:19 +01:00
f51a35732c fix(api_server): update voice STT patch for Onyx 5.0.3 image layout
The previous Python-heredoc patch (written for 4.8.2) broke silently on
5.0.3 because:

- The Docker image installs the backend at a different path than
  /app/onyx/ (repo restructured to backend/onyx/ in 5.0.0). Hardcoded
  paths caused every patch to no-op.
- 5.0.3 switched from the OpenAI Python SDK (which expects /v1 in
  base_url) to raw aiohttp that appends /v1/audio/... to the base URL
  itself. The old /v1 suffix in the LocalAI URL produced a double
  prefix: /v1/v1/audio/transcriptions → 404.

Changes:
- Replace Python heredoc with shell sed + dynamic path resolution
  (python -c 'import ...' with prefix fallback loop).
- Remove /v1 from LocalAI base URL (https://aido-whisper-ch.livtec.cloud).
- Add set -e so real shell errors are not swallowed.
- Add inline grep verification after each patch block so docker logs
  shows exactly which patterns matched.
- Language injection now tries both aiohttp FormData (add_field) and
  dict-literal anchors instead of one fixed SDK-call string.
- Remove corruption-cleanup logic (repeated or "..." chains) that was
  only needed because the old sed ran non-idempotently on a persisted
  volume. The new approach is idempotent by design.
- Annotate VOICE_DISABLE_STREAMING_STT as inert in 5.0.3 (not
  referenced in the voice module source); kept for forward-compat.
2026-11-12 19:58:27 +01:00
8143cc123f fix(compose): repair STT after Onyx 5.0.3 upgrade and fix silent alembic skip
fix(compose): repair STT after Onyx 5.0.3 upgrade and fix silent alembic skip

- Replace fragile runtime `sed` patches with idempotent Python patching in
 api_server entrypoint. The old `sed` heuristics broke because Onyx 5.x
 refactored the voice provider to use the OpenAI SDK
 (`client.audio.transcriptions.create`) instead of raw HTTP payloads,
 causing the language parameter to never be injected and the model
 fallback to corrupt factory.py with chained `or` expressions.

- Add `WHISPER_MODEL` env override (defaults to `whisper-1`) so the
 transcription payload uses the exact model name exposed by the backend
 proxy. Fixes 404 "model not found" against self-hosted Whisper/LiteLLM.

- Fix critical Docker bug where `command` was passed as an argument to
 the custom `entrypoint` and silently ignored. `alembic upgrade head`
 now runs inside the entrypoint before Uvicorn starts.

- Merge upstream compose improvements:
 * Add json-file logging (50m/6 rotation) to web_server, relational_db,
   and code-interpreter
 * Add code-interpreter healthcheck
 * Include optional MCP server block (commented out)

- Preserve existing Livtec customizations:
 * Voice endpoint redirected to aido-whisper-ch.livtec.cloud
 * WHISPER_LANGUAGE=de injected into SDK transcribe() call
 * Custom livtec/aido-web:local branded image
 * Bind mounts for logs, caches, and file-system
2026-11-08 11:37:02 +01:00
83fb8b299e Update docker-compose.yml 2026-10-01 23:50:05 +02:00
3e7309f588 fix(compose): merge upstream improvements and fix silent alembic skip
fix(compose): merge upstream improvements and fix silent alembic skip

- Fix critical Docker behavior bug where the separate `command` block on
  `api_server` was being passed as an argument to the custom `entrypoint`
  and silently ignored. `alembic upgrade head` is now executed inside
  the entrypoint before Uvicorn starts, ensuring DB migrations run.

- Add missing upstream logging blocks (json-file, 50m/6 rotation) to
  `web_server`, `relational_db`, and `code-interpreter`.

- Add upstream `healthcheck` to `code-interpreter` for accurate status.

- Include optional upstream `mcp_server` service block (commented out).
2026-10-01 23:26:34 +02:00
e6ab01f6e2 feat(voice): override OpenAI voice defaults for custom Whisper proxy
feat(voice): override OpenAI voice defaults for custom Whisper proxy

Replace api_server command with entrypoint that patches Onyx voice
provider files at runtime. Required because v4.8.x UI does not allow
setting api_base/stt_model for OpenAI Whisper.

- Force chunked HTTP STT via VOICE_DISABLE_STREAMING_STT=true
- Redirect all OpenAI voice constants to aido-whisper-ch.livtec.cloud
- Add WHISPER_LANGUAGE=de env var for transcription language
2026-10-01 22:33:30 +02:00
9903f9dca7 refactor: extract LiteLLM into dedicated aido-litellm stack
LiteLLM proxy, database and Redis are no longer
managed by this repository. They have moved to aido-litellm.

- Remove litellm-proxy, litellm-db, litellm-redis services from
  docker-compose.yml
- Remove litellm-config.yaml (now maintained in aido-litellm)
- Prune LiteLLM-specific environment variables from .env.example
2026-09-30 23:59:26 +02:00
56b0e95790 feat: enhance LiteLLM proxy configuration and deployment setup
Configuration updates to the Aido deployment stack, focusing on LiteLLM proxy hardening, improved model configuration, and enhanced environment setup.
2026-08-14 23:18:57 +02:00
NaeemDosh
1e55297ce9 fix(compose): correct litellm-redis command indentation (broke whole file)
The litellm-redis `command:` was indented at service level (2 spaces) instead of
inside the service (4 spaces), so Docker Compose parsed it as a bogus top-level
service named `command` and rejected the entire file with:
  services.command must be a mapping
This made `docker compose <anything>` fail — the whole stack was unstartable.
Re-indented it under litellm-redis; `docker compose config` now validates.
2026-08-02 15:04:14 +05:00
livdebus
7a618d4a74 feat: production hardening with LiteLLM proxy integration and security updates
## Overview
Major production readiness update integrating LiteLLM proxy for AI model
management, security hardening, and infrastructure simplification.

## Changes

### 🔐 Security & Secrets Management
- Auto-generate secrets via `openssl rand -hex` for:
  - `USER_AUTH_SECRET`, `ENCRYPTION_KEY_SECRET`, `METRICS_AUTH_TOKEN`
  - `POSTGRES_PASSWORD`, `LITELLM_*` credentials
- Set `DISABLE_TELEMETRY=true` for data sovereignty compliance
- Changed `POSTGRES_USER` from `postgres` → `onyx-admin`
- Set `TRACK_EXTERNAL_IDP_EXPIRY=true`

### 🤖 LiteLLM Proxy Integration
- **New service**: `litellm-proxy` with dedicated Postgres + Redis
- **New config**: `litellm-config.yaml` with 3 Swiss-hosted models:
  - `LivQwen` (Qwen3.5-397B-A17B-FP8)
  - `LivKimi` (Kimi-K2.6)
  - `LivGemma` (NVIDIA Nemotron-3-Nano-30B-A3B-FP8)
- Model fallback routing: LivQwen ↔ LivKimi ↔ LivGemma
- Caching enabled via Redis with 3600s TTL
- Custom error message mappings for user-friendly responses

### 🏗️ Infrastructure Updates
- Switched from local builds → official Onyx Docker images
  - Removed `build.context` for api_server, background, inference/indexing servers
- Increased NGINX timeouts: 300s → 600s (for complex AI queries)
- Added PostgreSQL connection pooling & keepalive settings
- S3 credentials now fully environment-driven (no hardcoded values)
- Added `S3_REGION` variable
- Removed certbot service (SSL handled externally)

### ⚙️ Configuration
- `COMPOSE_PROFILES=s3-filestore` uncommented
- `DISABLE_LITELLM_STREAMING=false`
- `LLM_SOCKET_READ_TIMEOUT=600`
- `GENERATIVE_MODEL_ACCESS_CHECK_FREQ=300` (5 minutes)
2026-06-30 23:04:24 +02:00
livdebus
4216fd1c13 minio commented out
We use external S3 provider, therefore we dont need minio
2026-06-30 21:02:24 +02:00
NaeemDosh
a7e31fcfbd Consolidate stack into one docker-compose.yml + restore minio + publish port
- web_server: branded livtec/aido-web:local from ./web, pull_policy never
- restore minio (S3 file store) the flattened compose dropped — api_server
  requires S3_ENDPOINT_URL=http://minio:9000 and won't start without it
- nginx published on ${HOST_PORT:-3000} → out-of-the-box http://localhost:3000
- Makefile targets the single file (no override chain)
- README: ./web layout, one-compose flow, USER_AUTH_SECRET + first-boot notes
- gitignore runtime data dirs (db_volume, model caches)

Verified: stack converges healthy on the single file; localhost:3000 + /api/health both 200.
2026-06-30 12:27:15 +05:00
livdebus
1d650c4d30 refactor: flatten structure, sparse-checkout upstream, add base compose for dockge/traefik
Replace the nested `onyx/` full-clone approach with a flattened, self-contained
deployment structure:

- `make setup` now uses `git sparse-checkout` to fetch only `web/` and
  `deployment/data/nginx/` from upstream, extracting them flat into `./web`
  and `./data/nginx`. This avoids downloading the entire Onyx repository
  when we only rebuild the branded web container ourselves.
- Add a top-level `docker-compose.yml` as the base stack file instead of
  referencing paths inside `onyx/deployment/...`. This keeps the compose
  project in the repo root so it can be managed by dockge and simplifies
  putting Traefik in front of the Onyx nginx.
- Update `docker-compose.branding.yml` build context from `./onyx/web` to `./web`.
- Update `branding.config.json`:
  - `webSrcRoot`: `onyx/web` → `web`
  - `pinnedCommit`: pinned hash → `main`
  - Add rename literals for "Open Source AI Platform" → "Powered by Livtec"
    and `https://www.onyx.app` → `https://livtec.cloud`
- Replace the minimal `.env.example` with the full Onyx deployment template.
- Add `setup.sh` for server provisioning (Node.js 25, make, /opt/stacks/onyx).
- Update `make verify` to search `./web/src` instead of `./onyx/web/src`.

All backend/model services continue to use official upstream Docker images;
only the `web_server` image is built locally from the branded source.
2026-06-29 12:43:31 +02:00