QAI SDK

Modular, type-safe Rust SDK for unified AI orchestration across 6+ providers with structured output, middleware, agents, and MCP.

v0.1.3 ๐Ÿฆ€ Rust 6+ Providers Zero-cost Abstractions Async/Await crates.io
6+
Providers
6
Model Traits
4
Advanced Features
2
MCP Transports
0
Cost Abstraction
Select Provider
main.rs โ— Ready

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.

qai-sdk v0.1.3 ยท MIT / Apache-2.0 ยท crates.io ยท GitHub ยท by Keyvan Arasteh