agentsdk-0.5.2 has been yanked.
AGENTSDK
An open-source, provider-agnostic Rust library for building AI-powered applications, inspired by the Vercel AI SDK. Type-safe, framework-friendly, and ready to connect with 70+ AI providers.
To learn more about how to use the AGENTSDK, check out our Documentation and API Reference.
Features
- Agents & Tool Execution
- Prompt Templating
- Text Generation & Streaming
- Structured Output (JSON Schema)
- Embedding Model Support
- Compatible with Vercel AI SDK UI (React, Solid, Vue, Svelte, …)
- Supports 73+ providers, including Anthropic, Google, OpenAI, OpenRouter, xAI
Installation
Usage
Enable Providers of your choice such as OpenAI, Anthropic, Google, and more
Example with OpenAI provider
Basic Text Generation
use LanguageModelRequest;
use OpenAI;
async
Agents
Defining a Tool
Use the #[tool] macro to expose a Rust function as a callable tool.
use Tool;
use tool;
/// Get the weather information given a location
Using Tools in an Agent
Register tools with an agent so the model can call them during its reasoning loop.
use ;
use OpenAI;
async
### Prompts
The AGENTSDK prompt feature provides, file-based template system for managing AI prompts using the Tera template engine. It allows you to create reusable prompt templates with variable substitution, conditionals, loops, and template inclusion. See [Examples](https://agentsdk.rs/docs/concepts/prompt) for more template examples. Enable with `cargo add agentsdk --features prompt`
### Roadmap
- [ ] Image Model Request Support
- [ ] Voice Model Request Support
- [ ] Observability & OpenTelemetry (OTel) Support
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
## License
Licensed under the MIT License. See [LICENSE](./LICENSE) for details.