Skip to main content

One agent,
Any Model

Build provider-neutral AI agents with typed Rust tools.

use freyja::{Agent, Client, EndpointPreset};

let client = Client::from_env(
EndpointPreset::OpenAi
)?;

let agent = Agent::new(client)
.system("Answer in one short sentence.");

let result = agent.ask("What is Rust?").await?;
println!("{}", result.answer);
Switch providers. Keep your agent.
cargo add freyja
Rust 1.88 or laterPre-1.0, unstable API.

Rust types in.
Tools out.

#[tool] derives the argument schema and executor. The agent runs the loop. Your storage keeps the transcript.

Explore typed tools
#[tool(description = "adds two numbers")]
fn add(a: i64, b: i64) -> i64 {
a + b
}

let agent = Agent::new(client)
.tool(add)
.memory(Window::last(20));