Aegis is a Rust-based adapter library that provides a unified interface for interacting with various AI providers, including Anthropic's Claude and OpenAI's GPT models.
- 🤖 Unified interface for multiple AI providers
- 🔑 Secure API key management
- 🖥️ Command-line interface (CLI)
- 📡 Async communication with AI providers
- 📝 Support for both single messages and streaming responses
- 🛡️ Robust error handling
- Rust 1.82.0 or higher
- Cargo package manager
git clone https://github.com/thevuuranusls/aegis.git
cd aegis
cargo test
cargo build --release- Configure your API keys:
aegis-cli config- Send a message:
aegis-cli chat --provider anthropic --content "What is the capital of Vietnam?"use aegis::{Aegis, AegisConfig, Message};
use aegis::models::ProviderType::Anthropic;
#[tokio::main]
async fn main() {
// Initialize with API key
let config = AegisConfig::new()
.with_anthropic("your-api-key".to_string());
let aegis = Aegis::new(config);
// Create a message
let messages = vec![Message {
role: "user".to_string(),
content: "What is the capital of Vietnam?".to_string(),
}];
// Send message and handle response
match aegis.send_message(Anthropic, messages).await {
Ok(response) => println!("Response: {}", response),
Err(e) => eprintln!("Error: {}", e),
}
}API keys can be configured in two ways:
- Environment variables:
ANTHROPIC_API_KEYOPENAI_API_KEY
- Using the CLI configuration tool
- Anthropic (Claude)
- OpenAI (GPT models) - Coming soon
- More providers planned
cargo testContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rust 🦀
- Powered by Anthropic's Claude and OpenAI's GPT models