AgenticOptioRS
Command. Coordinate. Execute.
AgenticOptioRS is a disciplined AI agent library built for reliable multi-model orchestration. Named after the Roman military Optio—the trusted second-in-command who coordinated formations, supervised operations, and stepped in as acting commander—this framework embodies the same principles of tactical coordination, operational resilience, and execution discipline.
This is the Rust implementation of AgenticOptio, providing high-performance, type-safe AI agent coordination.
Why "Optio"? In Roman legions, an Optio was the backbone of military precision—responsible for coordination, training supervision, and maintaining formation integrity. They were the reliable officers who transformed strategic vision into flawless tactical execution. AgenticOptio brings this same operational excellence to AI agent coordination.
Features
Current (v0.1.0)
- OllamaChat: Chat with local Ollama models
- OllamaEmbedding: Generate embeddings using local Ollama models
- Async Support: Full async/await support using Tokio
- Streaming: Real-time streaming responses
- Type Safety: Rust's type system ensures correctness at compile time
- Zero-cost Abstractions: High performance with minimal overhead
Coming Soon
- OpenAI Integration: GPT-4, GPT-3.5-turbo support
- Anthropic Claude: Claude 3.5 Sonnet and other models
- Google Gemini: Gemini Pro and Flash models
- Groq: Fast inference with Llama and Mixtral
- Tool Support: Function calling capabilities
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Requirements: Rust 1.70+
Prerequisites
For Ollama (Current)
- Install and run Ollama
- Pull a model:
ollama pull llama3.2
Quick Start
Basic Chat
use ;
async
Streaming Responses
use ;
use StreamExt;
async
Embeddings
use OllamaEmbedding;
async
Configuration
Custom Ollama Host
use OllamaChat;
let llm = builder
.host
.temperature
.max_tokens
.build;
Environment Variables
OLLAMA_HOST: Default Ollama host URL (default:http://localhost:11434)
API Reference
OllamaChat
// Create with defaults
let llm = new;
// Create with builder
let llm = builder
.host
.temperature
.max_tokens
.timeout
.max_retries
.build;
// Invoke
let response = llm.invoke.await?;
// Stream
let stream = llm.stream.await?;
OllamaEmbedding
// Create with defaults
let embedder = new;
// Create with builder
let embedder = builder
.host
.batch_size
.timeout
.build;
// Embed multiple texts
let embeddings = embedder.embed.await?;
// Embed single query
let embedding = embedder.embed_query.await?;
Examples
Run the examples:
# Basic usage
# Streaming
Roadmap
v0.2.0 - Strategic Alliance
- OpenAI GPT integration (GPT-4o, GPT-4o-mini, GPT-3.5-turbo)
- OpenAI embedding support
- Unified deployment protocols
v0.3.0 - Allied Forces
- Anthropic Claude integration
- Google Gemini coordination
- Groq rapid response units
v0.4.0 - Advanced Tactics
- Standardized tool/function calling protocols
- Enhanced streaming capabilities
- Batch processing for large-scale deployments
- Intelligent rate limiting and resilience patterns
v1.0.0 - Battle Ready
- Full test coverage
- Comprehensive documentation
- Performance optimizations
- Production stability guarantees
The Optio Advantage
In Roman legions, the Optio was the disciplined officer who transformed strategy into flawless execution. AgenticOptio brings this same operational excellence to AI:
Command Structure
- Unified Command: Single interface governing all model providers
- Type Safety: Rust's type system prevents errors at compile time
- Tactical Flexibility: Adapt to any model or provider seamlessly
Operational Discipline
- Reliability First: Battle-tested patterns with comprehensive error handling
- Resource Management: Efficient coordination of compute and memory
- Zero-cost Abstractions: High performance without runtime overhead
Strategic Readiness
- Multi-Theater Operations: Local models (Ollama) and cloud APIs in unified formation
- Rapid Deployment: Minimal dependencies for quick battlefield setup
- Scalable Command: From single agents to complex multi-agent orchestrations
Comparison with Python Version
| Feature | Python | Rust |
|---|---|---|
| Type Safety | Runtime | Compile-time |
| Performance | Good | Excellent |
| Memory Safety | GC | Ownership |
| Async | asyncio | Tokio |
| Dependencies | Minimal | Minimal |
| Ease of Use | Very Easy | Easy |
License
MIT License
Links
- Crates.io: https://crates.io/crates/agentic_optio_rs
- Documentation: https://docs.rs/agentic_optio_rs
- GitHub: https://github.com/kactlabs/agenticoptio-rs
- Python Version: https://pypi.org/project/agenticoptio/