Repository navigation
Testing
pip install pytest # not listed in requirements.txt
python -m pytest tests -q # from the repository rootExpected: 47 passed (plus a harmless third-party deprecation warning). The suite needs no network access and no API keys, and it never touches your real database: tests/conftest.py points DATABASE_URL at a temporary file before the app is imported.
| File | Tests | Covers |
|---|---|---|
tests/test_llm.py |
33 | Tier setting parsing and defaults; Anthropic request shape (no temperature, effort, cache breakpoint on the system prompt, usage logging); Sonnet refusal fallback and its retry; refusal and empty-output errors; missing-key error; DeepSeek thinking on and off, low and high effort, blank-JSON retry, usage logging; mixed providers; JSON parsing; the generator's tier choices and fallbacks. Uses fake clients |
tests/test_concurrency.py |
5 | SQLite uses WAL and a 30 s timeout; verification, LLM calls and retrieval do not block the event loop; verification runs one at a time |
tests/test_build_vector_store.py |
4 | The vector-store build script: builds the collection with the expected metadata, a re-run embeds nothing and does not fail, only new or edited chunks are re-embedded, --reset drops stale chunks. Uses a fake embedder |
tests/test_warmup.py |
5 |
PRELOAD_MODELS switch; both models are preloaded; a preload failure is logged, not raised; startup runs or skips the preload |
The concurrency tests measure the longest pause of a heartbeat task while slow stand-ins run. They fail against the pre-fix code, which is how they were checked.
- Retrieval quality and the embedding, re-ranking and NLI models (see Evaluation).
- The HTTP endpoints end to end. A
TestClienttest of/querywith a stubbed pipeline would have caughtcitations_presentbeing dropped from the response (Known Issues and Limitations). - Prompt quality, database migrations and real provider calls.
Real provider calls are checked by hand: start the app and call each endpoint (Getting Started). Watch the log for the [LLM] ... usage: lines.
Follow tests/test_llm.py: inject a fake client into llm._clients and set LLM_MODEL_* with monkeypatch. Keep tests offline.
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