Which guide? Modifying
mellea/,cli/, ortest/→ this file. Writing code that imports Mellea →docs/AGENTS_TEMPLATE.md.
pre-commit install # Required: install git hooks
uv sync --all-extras --all-groups # Install all deps (required for tests)
ollama serve # Start Ollama (required for most tests)
uv run pytest -m "not qualitative" # Skips LLM quality tests (~2 min)
uv run pytest # Full suite (includes LLM quality tests)
uv run ruff format . && uv run ruff check . # Lint & formatBranches: feat/topic, fix/issue-id, docs/topic
| Path | Contents |
|---|---|
mellea/stdlib |
Core: Sessions, Genslots, Requirements, Sampling, Context |
mellea/backends |
Providers: HF, OpenAI, Ollama, Watsonx, LiteLLM |
mellea/helpers |
Utilities, logging, model ID tables |
cli/ |
CLI commands (m serve, m alora, m decompose, m eval) |
test/ |
All tests (run from repo root) |
scratchpad/ |
Experiments (git-ignored) |
@pytest.mark.qualitative— LLM output quality tests (skipped in CI viaCICD=1)- Unmarked — Unit tests (may still require Ollama running locally)
qualitative to trivial tests—keep the fast loop fast.
- Types required on all core functions
- Docstrings are prompts — be specific, the LLM reads them
- Google-style docstrings
- Ruff for linting/formatting
- Use
...in@generativefunction bodies - Prefer primitives over classes
Angular format: feat:, fix:, docs:, test:, refactor:, release:
Pre-commit runs: ruff, mypy, uv-lock, codespell
Don't cancel:
pytest(full) andpre-commit --all-filesmay take minutes. Canceling mid-run can corrupt state.
| Problem | Fix |
|---|---|
ComponentParseError |
Add examples to docstring |
uv.lock out of sync |
Run uv sync |
| Ollama refused | Run ollama serve |
uv run pytest -m "not qualitative"passes?ruff formatandruff checkclean?- New functions typed with concise docstrings?
- Unit tests added for new functionality?
- Avoided over-engineering?
- Place tests in
test/mirroring source structure - Name files
test_*.py(required for pydocstyle) - Use
gh_runfixture for CI-aware tests (seetest/conftest.py) - Mark tests checking LLM output quality with
@pytest.mark.qualitative - If a test fails, fix the code, not the test (unless the test was wrong)
Found a bug, workaround, or pattern? Update the docs:
- Issue/workaround? → Add to Section 7 (Common Issues) in this file
- Usage pattern? → Add to
docs/AGENTS_TEMPLATE.md - New pitfall? → Add warning near relevant section