Ailloy provides a unified interface for interacting with multiple AI providers from Rust — both as a CLI tool for quick tasks and scripting, and as a library for integration into your own projects.
Quick Start
Install the CLI
# Homebrew (macOS/Linux)
# Cargo
# Cargo binstall (pre-built binary)
Configure a provider
Send a message
Use as a Library
Add ailloy to your project without CLI dependencies:
[]
= { = "0.2", = false }
= { = "1", = ["rt-multi-thread", "macros"] }
= "1"
Async (recommended)
use ;
async
Blocking (sync)
use Client;
use Message;
Programmatic (no config file needed)
use ;
async
Builder pattern
use ;
async
Providers
| Provider | Kind | Chat | Stream | Images | Embeddings | Auth |
|---|---|---|---|---|---|---|
| OpenAI | openai |
yes | yes | DALL-E | yes | API key |
| Anthropic | anthropic |
yes | yes | — | — | API key |
| Azure OpenAI | azure-openai |
yes | yes | yes | yes | API key / az CLI |
| Microsoft Foundry | microsoft-foundry |
yes | yes | — | yes | API key / az CLI |
| Google Vertex AI | vertex-ai |
yes | yes | Imagen | yes | gcloud CLI |
| Ollama | ollama |
yes | yes | — | yes | None |
| Local Agent | local-agent |
yes | yes | — | — | None |
Configuration
Ailloy stores its configuration at ~/.config/ailloy/config.yaml:
defaults:
chat: openai
image: dalle
providers:
openai:
kind: open-ai
api_key: sk-...
model: gpt-4o
anthropic:
kind: anthropic
api_key: sk-ant-...
model: claude-sonnet-4-6
dalle:
kind: open-ai
api_key: sk-...
model: dall-e-3
task: image-generation
ollama:
kind: ollama
model: llama3.2
claude:
kind: local-agent
binary: claude
Local project config
Create .ailloy.yaml in your project root to override or add providers for that project. Local config is merged with global config.
CLI Commands
| Command | Description |
|---|---|
ailloy <message> |
Send a message (shorthand for ailloy chat) |
ailloy chat <message> |
Send a message to the configured AI provider |
ailloy chat -i |
Interactive conversation mode |
ailloy config |
Interactive provider configuration |
ailloy config show |
Display current configuration |
ailloy providers list |
List configured providers |
ailloy providers detect |
Auto-detect available providers |
ailloy completion <shell> |
Generate shell completions |
ailloy version |
Show version and banner |
Options
|
Feature Flags
Ailloy uses feature flags to keep the library lean:
| Feature | Default | Description |
|---|---|---|
cli |
Yes | CLI binary and dependencies (clap, inquire, colored, etc.) |
Library users should disable default features:
= { = "0.2", = false }
Development
License
MIT