#ai-agent #pydantic #llm #serde #llm-agent

serdes-ai

Type-safe, production-ready AI agent framework for Rust - a full port of pydantic-ai

8 releases

0.2.6 Feb 20, 2026
0.2.5 Feb 17, 2026
0.1.5 Jan 27, 2026

#1491 in Asynchronous

Download history 108/week @ 2026-01-20 187/week @ 2026-01-27 20/week @ 2026-02-03 10/week @ 2026-02-10 42/week @ 2026-02-17 58/week @ 2026-02-24 6/week @ 2026-03-03 38/week @ 2026-03-10 7/week @ 2026-03-17 11/week @ 2026-03-24 109/week @ 2026-03-31 111/week @ 2026-04-07

247 downloads per month
Used in 3 crates (2 directly)

MIT license

2MB
47K SLoC

serdes-ai

Crates.io Documentation License: MIT

Type-safe, production-ready AI agent framework for Rust - a full port of pydantic-ai

This is the main facade crate that re-exports all SerdesAI functionality for convenient use.

Installation

[dependencies]
serdes-ai = "0.1"

Quick Start

use serdes_ai::prelude::*;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let agent = Agent::new(OpenAIChatModel::from_env("gpt-4o")?)
        .system_prompt("You are a helpful assistant.")
        .build();
    
    let result = agent.run("Hello!", ()).await?;
    println!("{}", result.output);
    
    Ok(())
}

Features

  • 🤖 Type-safe Agents - Generic over dependencies and output types
  • 🔌 Multi-provider Support - OpenAI, Anthropic, Google, Groq, Mistral, Ollama, and more
  • 🛠️ Tool Calling - Define tools with automatic JSON schema generation
  • 📡 Streaming - Real-time response streaming
  • 🔄 Smart Retries - Configurable retry strategies
  • 🔀 Graph Workflows - Complex multi-agent orchestration

Part of SerdesAI

This crate is part of the SerdesAI workspace.

License

MIT License - see LICENSE for details.

Dependencies

~16–30MB
~451K SLoC