Files
tobayahandClaude Opus 4.7 944eed2106 feat: provider-agnostic LLM gateway + curated profiles (Sprint 3, ADR-002)
- ADR-002 formalizuje BYOK + 5 curated profiles + Claude Code side-channel
- packages/llm-gateway: LLMGatewayConfig (pydantic-settings env-driven),
  profile-based routing (cloud-cheap/cloud-premium/local-data-sovereign/
  hybrid/custom), Ollama models (Bielik 11B, Llama 3.3 70B), mock provider
  deterministic stub, hybrid promotion logic, routing_decision w Langfuse
  trace metadata; GatewayRejected nadal provider-agnostic
- packages/evals: mock mode (CI bez ANTHROPIC_API_KEY), --profile flag
  w conftest, lazy import compass_agents
- .claude/skills/compass-legal-review: internal-use side-channel workflow
  (Claude Code reuses packages/* jako library, 12-pkt self-check)
- scripts/setup_local_llm.{sh,ps1}: Ollama+Bielik bootstrap (winget/curl)
- CLAUDE.md + .env.example: BYOK + 5 profiles + model routing matrix
  per profile + cross-references do ADR-002 + compass-legal-review skill

Tests: 17/17 llm-gateway config, 9/9 evals --profile=mock,
8/9 default (1 correct skip without ANTHROPIC_API_KEY).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:54:47 +02:00

69 lines
3.1 KiB
Bash

# Compass — env template. Copy to .env.local and populate.
# NEVER commit .env.local — see CLAUDE.md security invariant #9.
# ---------- LLM provider selection (BYOK + local LLM hybrid, ADR-002) ----------
# Pick ONE curated profile (preferred) OR set provider/endpoint/model directly.
# Default deployment: local-data-sovereign (on-prem moat #4 jako default).
#
# Profiles:
# cloud-cheap — anthropic, Sonnet 4.6 (typical) + Haiku 4.5 (bulk)
# cloud-premium — anthropic, Opus 4.7 (all tasks)
# local-data-sovereign — ollama, Bielik 11B v2.3 (PL) + Llama 3.3 70B (fallback)
# hybrid — ollama primary; promote to cloud on critical/long-ctx
# custom — BYOK, set LLM_DEFAULT_MODEL + LLM_ENDPOINT yourself
LLM_PROFILE=local-data-sovereign
LLM_PROVIDER=ollama # anthropic | ollama | azure | openai | mock
LLM_ENDPOINT=http://localhost:11434 # Ollama base URL; blank for cloud autodetect
LLM_API_KEY=ollama # Ollama uses dummy 'ollama' string; cloud: real key
# LLM_DEFAULT_MODEL= # BYOK override (exact LiteLLM model string)
# ---------- Cloud provider keys (only if LLM_PROVIDER in {anthropic, openai, azure}) ----------
ANTHROPIC_API_KEY=sk-ant-...
VOYAGE_API_KEY=pa-...
GEMINI_API_KEY=AIza...
# Optional: OPENAI_API_KEY=sk-... (only if multi-provider fallback chain enabled)
# ---------- Local LLM (only if LLM_PROVIDER=ollama) ----------
OLLAMA_API_BASE=http://localhost:11434 # set automatically by gateway from LLM_ENDPOINT
# Run scripts/setup_local_llm.sh to install Ollama + pull Bielik weights
# ---------- Supabase (auth + DB + storage) ----------
SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_ANON_KEY=eyJ...
# Service role: ADMIN operations only, never used in business-logic handlers
# (see CLAUDE.md security invariant #1)
SUPABASE_SERVICE_ROLE_KEY=eyJ...
# ---------- Database (direct connection for migrations + Celery beat schedules) ----------
DATABASE_URL=postgresql://postgres:<password>@db.<project-ref>.supabase.co:5432/postgres
# ---------- Redis (Celery broker + SSE pub/sub) ----------
REDIS_URL=redis://localhost:6379/0
# ---------- Qdrant (vector store, multi-tenant payload filtering) ----------
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=
# ---------- Langfuse (LLM observability, per ADR-001 M8) ----------
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_HOST=http://localhost:3001
# Set to "false" in pytest unit tests to disable Langfuse roundtrip
LANGFUSE_ENABLED=true
# ---------- FastAPI app ----------
APP_ENV=development # development | staging | production
APP_LOG_LEVEL=INFO
APP_PORT=8000
APP_CORS_ORIGINS=http://localhost:8080
# ---------- Frontend (apps/web — Vite exposes only VITE_*) ----------
VITE_SUPABASE_URL=https://<project-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=eyJ...
VITE_API_BASE_URL=http://localhost:8000
# ---------- Optional, Sprint 3+ ----------
# AUTHENTIK_URL= # self-hosted SSO (replaces Supabase Auth pre enterprise)
# HETZNER_STORAGE_BOX_ACCESS_KEY= # S3-compatible file storage on self-hosted phase
# HETZNER_STORAGE_BOX_SECRET=