Contributing¶
Thanks for considering a contribution.
Dev setup¶
Clone and install with all extras:
Or with uv (faster):
For gated HuggingFace models, log in once:
Run the tests¶
The default suite is mock-based and needs no backend:
To run against a real backend:
pytest tests/test_models.py --client=ollama --model=QWEN_3_5_9B
pytest tests/test_models.py --client=anthropic
pytest tests/test_models.py --client=llamacpp --model-path=/path/to/model.gguf
See CLAUDE.md for the full list of --client options.
Linting¶
Ruff is configured in pyproject.toml (line length 120):
Build the docs locally¶
The site rebuilds on file changes. Browse at http://127.0.0.1:8000.
To check for broken links and missing pages:
Coding conventions¶
- Plain Python over framework primitives. No
Runnableprotocol, noBaseTool, no LCEL|, no Pydantic for tool args. See design principles for the full list of what's deliberately out of scope. - OpenAI message dicts as the only data model. No
Messageclass. Provider-specific formats are adapted at request time, never persisted. - Loud failures. Bad input raises with an actionable message. Silent skips and
try/except: passare reviewed carefully.
Adding a new provider¶
Briefly: subclass BaseModelClient, implement _chat, _generate, and _update_generate_kwargs. Define a Model enum subclass listing supported models with ModelSpec(...) values. Add isinstance dispatch in ModelClient.__init__ and a registry entry in _provider_registry() so model strings work. Add the provider's Model import to aimu/models/__init__.py guarded by a HAS_* flag for the optional dependency.
See an existing provider (e.g. AnthropicClient) for the full pattern.
Adding a new model to an existing provider¶
Add a member to the provider's Model enum with a ModelSpec(id, tools=..., thinking=..., vision=...) value. The TOOL_MODELS / THINKING_MODELS / VISION_MODELS lists derive automatically. See how-to: add a new model.
Pull requests¶
- One concern per PR. Splitting a refactor across multiple PRs makes review tractable.
- Include or update tests. Each module has a dedicated test file (
tests/test_models_api.py,tests/test_tool_decorator.py,tests/test_workflow_chain.py, etc.) — add new behavioural tests next to the existing ones for the surface you're touching. - Update docs when adding a public API. New
@tool-decorated function? Add it tobuiltin.<group>. New workflow? Add a tutorial or how-to. - Run
ruff check .andpytestbefore pushing.
Reporting bugs¶
File an issue with:
- A minimal reproducer (under 20 lines if possible).
- The full traceback.
- AIMU version, Python version, and which provider you were using.
Questions¶
Open a GitHub discussion. For Claude Code agents working in this repo, CLAUDE.md is the canonical engineering reference.