QAI SDK
Modular, type-safe Rust SDK for unified AI orchestration across 6+ providers with structured output, middleware, agents, and MCP.
Complete Feature Coverage
๐ฌ Chat Generation
Unified model.generate() across all providers. System prompts, multi-turn conversations, and complete token usage stats.
โก Streaming
Real-time StreamPart enum covering text deltas, tool call deltas, usage, finish reasons, and errors.
๐ง Tool Calling
First-class function calling with JSON Schema tool definitions. Works across OpenAI, Anthropic, Google, and compatible endpoints.
๐ Structured Output
generate_object() forces models to return validated JSON. Supports Json mode (native) and Tool mode (fallback).
๐๏ธ Provider Registry
Resolve models by string: "openai:gpt-4o". Central hub for multi-provider applications.
๐ Middleware
Composable LanguageModelMiddleware trait. Built-in: DefaultSettings, ExtractReasoning.
๐ค Universal Agent
Builder-pattern agent with iterative tool loop. Configurable max_steps and async tool handlers.
๐ MCP Protocol
Full MCP client: tools, prompts, resources, live subscriptions. Stdio and SSE transports.
๐ผ๏ธ Vision / Multimodal
Pass images via Content::Image. Supported on GPT-4o, Claude 3, and Gemini models.
๐ Embeddings
EmbeddingModel trait for text-embedding-3, text-embedding-004, and custom dimensions.
๐จ Image Generation
ImageModel trait for DALL-E 2/3 and Imagen. HD quality, custom sizes.
๐ TTS / STT
SpeechModel for text-to-speech (tts-1-hd). TranscriptionModel for Whisper speech-to-text.