Repository navigation
Configuration
All configuration is through environment variables. They are read from the process environment and from a .env file in the working directory (loaded by python-dotenv). .env is gitignored. .env.example lists every variable with no values.
Never commit .env or put key values in issues, logs or docs.
| Variable | Default | Effect |
|---|---|---|
ANTHROPIC_API_KEY |
none | Key for tiers using the anthropic provider |
DEEPSEEK_API_KEY |
none | Key for tiers using deepseek
|
OPENAI_API_KEY |
none | Key for tiers using openai
|
DEEPSEEK_BASE_URL |
https://api.deepseek.com |
Override the DeepSeek endpoint |
LLM_MODEL_COMPLEX |
anthropic:claude-sonnet-5-5:medium |
Model for long-form generation (/learn/text) |
LLM_MODEL_MEDIUM |
anthropic:claude-haiku-5-5:medium |
Model for grounded answers and structured lessons |
LLM_MODEL_EASY |
anthropic:claude-haiku-5-5:medium |
Model for small talk (and test-set question writing) |
ANTHROPIC_PROMPT_CACHE |
true |
false, 0 or no disables prompt caching |
ANTHROPIC_REFUSAL_FALLBACK |
true |
false, 0 or no disables the Sonnet refusal fallback |
PRELOAD_MODELS |
true |
false, 0 or no skips startup preloading |
DATABASE_URL |
sqlite+aiosqlite:///./nutripepper.db |
Log database; the default path is relative to the working directory |
APP_NAME |
NutriPepper Backend |
Title shown in the API docs |
APP_VERSION |
1.0.0 |
Version shown in the API docs (does not match the VERSION file, v0.1.0-alpha) |
DEBUG |
True |
Read into settings but not otherwise used |
LLM_MODEL_<TIER>=provider:model[:effort]
-
provider:
anthropic,deepseekoropenai. - model: the provider's model ID. It never contains a colon.
-
effort (optional, default
medium):off,low,medium,highormax. How it is applied differs by provider; see LLM Layer.
A malformed setting raises an error naming the bad value (Bad model spec ..., Unknown provider ..., Unknown effort ...).
| Task | Tier |
|---|---|
/query with retrieved context |
medium |
/query small talk with no context |
easy |
/learn/structured |
medium |
/learn/text |
complex |
| Evaluation test-set question writing | easy |
Default (Anthropic). No LLM_MODEL_* lines.
DeepSeek only.
LLM_MODEL_COMPLEX=deepseek:deepseek-flash:high
LLM_MODEL_MEDIUM=deepseek:deepseek-flash:low
LLM_MODEL_EASY=deepseek:deepseek-flash:low
Mixed. Keep the complex tier on Anthropic, move the others to DeepSeek:
LLM_MODEL_MEDIUM=deepseek:deepseek-flash:low
LLM_MODEL_EASY=deepseek:deepseek-flash:low
Changes take effect after a restart. Model IDs, effort levels and beta headers are provider-controlled and change over time; check the provider's documentation if a call is rejected.
Documentation last verified against the code on 2026-11-05. Evaluation figures are historical, see Evaluation. Educational tool, not medical advice.
Use it
How it works
- Architecture
- Retrieval Pipeline
- LLM Layer
- Prompts and Lessons
- Grounding Verification
- Knowledge Base
- Data and Logging
Quality
Develop