Edgee Rust SDK
Modern, type-safe Rust SDK for the Edgee AI Gateway.
Installation
Add this to your Cargo.toml:
[]
= "2.0"
= { = "1", = ["full"] }
Quick Start
use Edgee;
async
Send Method
The send() method makes non-streaming chat completion requests:
let response = client.send.await?;
// Access response
println!; // Text content
println!; // Finish reason
if let Some = response.tool_calls
// Access usage and compression info
if let Some = &response.usage
if let Some = &response.compression
Stream Method
The stream() method enables real-time streaming responses:
use StreamExt;
let mut stream = client.stream.await?;
while let Some = stream.next.await
Features
- ✅ Type-safe - Leverages Rust's powerful type system
- ✅ Async/await - Built on tokio for efficient async operations
- ✅ OpenAI-compatible - Works with any model supported by Edgee
- ✅ Streaming - First-class support with
Streamtrait - ✅ Tool calling - Full support for function calling
- ✅ Compression info - Access token compression metrics in responses
- ✅ Zero-cost abstractions - Efficient implementation with minimal overhead
Documentation
For complete documentation, examples, and API reference, visit:
👉 Official Rust SDK Documentation
The documentation includes:
- Configuration guide - Multiple ways to configure the SDK
- Send method - Complete guide to non-streaming requests
- Stream method - Streaming responses guide
- Tools - Function calling guide
Examples
Run the examples to see the SDK in action:
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.