AIMU¶
AI Modeling Utilities — a lightweight Python library for building AI-powered applications with a consistent, provider-agnostic interface across text, images, and audio.
Language models are the primary building block, with the same interface extending to image generation and audio processing. AIMU separates autonomous agents from code-controlled workflows, and treats agents as composable units that can be used anywhere a plain model client is accepted. Tool integration is structural (not a plugin), semantic and document memory can be dropped in, and a prompt-tuning loop optimises prompts against labelled data without ML machinery.
Install¶
Or pick the providers you need: aimu[ollama], aimu[anthropic], aimu[openai_compat], aimu[hf] (text + HF diffusers image generation), aimu[google] (Google Nano Banana image generation), aimu[llamacpp].
Quick start¶
import aimu
# One-shot
text = aimu.chat("Hello", model="anthropic:claude-sonnet-4-6")
# Multi-turn
client = aimu.client("ollama:qwen3.5:9b", system="You are concise.")
client.chat("Hi there")
client.chat("What did I just say?") # history preserved
That's the full mental model: a chat() function for one-shots, a client() factory for conversations, and provider:model_id strings to swap backends.
Where to next¶
-
Hands-on walkthroughs. Start here if you're new — install to first working agent in 15 minutes.
-
Task-oriented recipes. "How do I swap providers / write a tool / stream output / benchmark models?"
-
The full API surface, capability matrices, environment variables, and CLI commands.
-
The why. Architecture, design principles, the agent/workflow taxonomy, and what AIMU deliberately doesn't do.
What's in the box¶
- Provider-agnostic clients — Ollama, HuggingFace, llama-cpp, Anthropic, OpenAI, Gemini, plus every OpenAI-compatible local server (LM Studio, vLLM, SGLang, llama-server, HF Transformers Serve).
- Text-to-image —
aimu.image_client()andaimu.generate_image()parallel the text surface. HuggingFacediffusersfor local generation (SD 1.5 / SDXL / SD 3.5 / FLUX), Google Nano Banana for cloud. Drops into any chat agent via the built-ingenerate_imagetool. See how-to: generate images. - Agents and workflows —
Agentfor autonomous tool-using loops;Chain/Router/Parallel/EvaluatorOptimizerfor code-controlled patterns from Anthropic's Building Effective Agents. - Tools —
@tooldecorator for plain Python functions, plus a synchronousMCPClientwrapper for cross-process tools. - Skills — filesystem-discovered
SKILL.mdfiles that auto-inject capabilities into aSkillAgent. - Memory — semantic facts (ChromaDB), path-based documents (Anthropic Memory API), and conversation history (TinyDB).
- Prompt management — versioned SQLite catalog plus a hill-climbing tuner with classification, multi-class, extraction, and judged variants.
- Evaluation — DeepEval integration and a multi-model benchmark harness with CSV / JSON / catalog export.
- Optional async surface —
aimu.aiomirrors the whole sync API (same class names, one-import-away).Parallelandconcurrent_tool_callsuseasyncio.TaskGroupfor structured concurrency. See async design.
Notebooks¶
The notebooks/ directory ships 15 runnable demos covering every subsystem end-to-end, including a dedicated 14 - Async notebook for the aimu.aio surface and 15 - Image Generation for text-to-image. The README lists each one.