Skip to content

How-to guides

Task-oriented recipes. Each guide answers a specific question: how do I do this?

If you're new to AIMU, start with the tutorials instead; those build a working mental model. How-to guides assume you already know the basics and want the steps for a particular task.

Working with models

  • Switch providers: change backends without changing call sites
  • Add a new model: register a model enum member
  • Add or update a provider: write a provider client and wire it into the factory
  • Stream output: stream=True, phase filtering, helpers
  • Get structured output: schema= on chat() / generate() returns a typed dataclass/Pydantic object; native enforcement with a parse fallback
  • Use async (aio): embed AIMU in async apps; asyncio.TaskGroup-backed Parallel
  • Handle vision input: pass images via images=
  • Generate images: aimu.image_client() / generate_image() with HuggingFace diffusers + Google Nano Banana
  • Generate audio: aimu.audio_client() / generate_audio() with HuggingFace MusicGen, AudioLDM2, and Stable Audio
  • Generate speech: aimu.speech_client() / generate_speech() for TTS with HuggingFace MMS-TTS/BARK or OpenAI tts-1/tts-1-hd
  • Embed text: aimu.embedding_client() / embed() with OpenAI, Ollama, or local HuggingFace sentence-transformers; plug into SemanticMemoryStore
  • Iterative image refinement: a generate → evaluate → refine loop, built two ways (agent-directed vs code-directed)
  • Iterative text refinement: the GPU-free text twin of the above; generate → judge → refine across a code loop, an agent, a workflow class, and two search strategies

Tools

Agents and workflows

Memory and persistence

Prompts and evaluation