packages/artifacts: - render_cv_pdf(profile, sections) -> bytes: data-driven CV PDF generation using fpdf2 with bundled DejaVuSans TTF for unicode (Swedish chars tested). Jinja2 template for layout data prep, adapted from build_cv.py approach. - render_cover_letter(text, profile) -> bytes: simple cover letter PDF. - hash_bytes(b) -> str: sha256 hex digest. - next_version(existing) -> int: version numbering helper. - 16 tests, all passing: PDF validity, Swedish characters, hash stability, cover letter rendering, hash correctness, version logic. packages/llm-gateway: - Async-first Gateway class with provider config from env. - Mock mode default when no API key env present (deterministic canned outputs per task name, defined in mock.py). - Telemetry sink injectable (async or sync callable, receives TelemetryRow). - Budget guard raises BudgetExceeded BEFORE any provider call is made. - Retry policy: max 2 retries on 429/5xx, then fallback provider for STRONG tasks only. CHEAP tasks never use fallback (paid provider protection). - Schema validation via jsonschema; SchemaValidationError on mismatch. - Task class routing: CHEAP (score, extract, cv_assist) vs STRONG (critique, cl_critique, research). Model routing per task class. - Paid provider detection heuristic; warns on paid fallback config. - 31 tests, all passing: mock determinism, schema pass/fail, budget guard (mock + real mode), telemetry sink (async/sync/none), config from env, provider calls with mocked HTTP (retry, fallback, no-fallback-for-cheap). docker-compose.yml: - postgres:16 service, user/pass/db = jobhunt, host port 5433->5432, named volume jobhunt_pgdata, healthcheck. .env.example: - DATABASE_URL, LLM provider config (primary + fallback), task budgets, API and web settings.
37 lines
No EOL
1.1 KiB
Text
37 lines
No EOL
1.1 KiB
Text
# ---- Database ----
|
|
# Used by apps/api to connect to the postgres service defined in docker-compose.yml.
|
|
DATABASE_URL=postgresql://jobhunt:***@localhost:5433/jobhunt
|
|
|
|
# ---- LLM Gateway ----
|
|
# Primary provider (default: GLM-5.2 via ollama-cloud).
|
|
LLM_PRIMARY_BASE_URL=https://api.ollama-cloud.com/v1
|
|
LLM_PRIMARY_KEY=
|
|
# Alternative env name accepted by the gateway:
|
|
OLLAMA_API_KEY=
|
|
LLM_PRIMARY_MODEL=glm-5.2
|
|
|
|
# Optional fallback provider (same shape). Leave empty to disable fallback.
|
|
LLM_FALLBACK_BASE_URL=
|
|
LLM_FALLBACK_KEY=
|
|
LLM_FALLBACK_MODEL=
|
|
|
|
# Task class routing. Cheap task classes (score, extract) must never fall back
|
|
# to a paid provider. Cheap models are expected here.
|
|
LLM_CHEAP_MODEL=glm-5.2
|
|
LLM_STRONG_MODEL=glm-5.2
|
|
|
|
# Per-task token budgets (max output tokens). Over-budget raises before the call.
|
|
LLM_BUDGET_SCORE=2000
|
|
LLM_BUDGET_EXTRACT=4000
|
|
LLM_BUDGET_CRITIQUE=6000
|
|
LLM_BUDGET_CV_ASSIST=2000
|
|
LLM_BUDGET_CL_CRITIQUE=4000
|
|
LLM_BUDGET_RESEARCH=4000
|
|
LLM_BUDGET_DEFAULT=4000
|
|
|
|
# ---- API ----
|
|
API_HOST=0.0.0.0
|
|
API_PORT=8000
|
|
|
|
# ---- Web ----
|
|
VITE_API_BASE=http://localhost:8000/api |