Skip to main content
LLMAO Logo

LLMAO

Lightweight LLM API Orchestrator

One interface for all your LLM APIs, fast and simple

Python Rust License CI


A unified Python interface for multiple LLM providers with automatic key rotation and rate limit handling. Built with Rust core for performance.

Installation

pip install llmao-py

Quick Start

from llmao import LLMClient

client = LLMClient()

response = client.completion(
    model="groq/llama-3.1-70b-versatile",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response["choices"][0]["message"]["content"])

Model Format

Use provider/model routing:

# OpenAI
client.completion(model="openai/gpt-4o", messages=[...])

# Anthropic
client.completion(model="anthropic/claude-3-5-sonnet-20241022", messages=[...])

# Groq
client.completion(model="groq/llama-3.3-70b-versatile", messages=[...])

# Cerebras
client.completion(model="cerebras/llama3.1-70b", messages=[...])

Supported Providers

View all providers
Provider Environment Variable
OpenAI OPENAI_API_KEY
Anthropic ANTHROPIC_API_KEY
Groq GROQ_API_KEY
Cerebras CEREBRAS_API_KEY
Together TOGETHER_API_KEY
OpenRouter OPENROUTER_API_KEY
DeepSeek DEEPSEEK_API_KEY
Mistral MISTRAL_API_KEY
Fireworks FIREWORKS_API_KEY
Perplexity PERPLEXITY_API_KEY
SambaNova SAMBANOVA_API_KEY
NVIDIA NVIDIA_API_KEY
Hyperbolic HYPERBOLIC_API_KEY
DeepInfra DEEPINFRA_API_KEY
Novita NOVITA_API_KEY
Xiaomi MiMo XIAOMI_MIMO_API_KEY
Venice AI VENICE_AI_API_KEY
GLHF GLHF_API_KEY
Lepton LEPTON_API_KEY
Anyscale ANYSCALE_API_KEY
Ollama OLLAMA_API_KEY
LM Studio LMSTUDIO_API_KEY

Key Rotation

Automatic failover when rate limited. Configure multiple keys in your config.json:

{
  "openai/gpt-4": {
    "keys": ["sk-key1", "sk-key2", "sk-key3"],
    "rotation_strategy": "round_robin"
  }
}

Or use environment variables (suffix with _2, _3, etc.):

export OPENAI_API_KEY="sk-key1"
export OPENAI_API_KEY_2="sk-key2"
export OPENAI_API_KEY_3="sk-key3"

Configuration

LLMAO supports multiple configuration methods. See the examples/ directory for complete, runnable code for each scenario.

Contributing Providers

Want to add a new provider to LLMAO's built-in registry?

The registry.json file contains provider metadata (base URLs, default headers, etc.). Fork the repository, add your provider, and submit a pull request:

{
  "your_provider": {
    "base_url": "https://api.yourprovider.com/v1",
    "api_key_env": "YOUR_PROVIDER_API_KEY"
  }
}

Once merged, all users can use your provider without specifying base_url!

API Reference

from llmao import LLMClient, completion

# Client-based
client = LLMClient(config_path="./config.json")
client.completion(model, messages, temperature=0.7, max_tokens=100)
client.providers()  # List available providers
client.provider_info("openai")  # Get provider details

# Quick function
completion(model, messages, **kwargs)

Development

# Build from source
pip install maturin
maturin develop

# Run tests
cargo test

License

MIT

Metadata

Release files for llmao-py 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmao-py 0.0.1
File Size Uploaded
llmao_py-0.0.1.tar.gz 45.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for llmao-py 0.0.1
File
llmao_py-0.0.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
llmao_py-0.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
llmao_py-0.0.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
llmao_py-0.0.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.8 MB

Release files / llmao_py-0.0.1.tar.gz

Download URL llmao_py-0.0.1.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9fa2b5f072af00049c9723ff56527e45c2858325a608c7255b5537a78356523a
BLAKE2b-256 checksum
How to use checksums
d14d2da408af4a212739ecde31d174b0e67b396c7125d060c419005fe561e954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / llmao_py-0.0.1-cp39-abi3-win_amd64.whl

Download URL llmao_py-0.0.1-cp39-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2f428959f4d0e181647759c36c55604e787aeebb25da8694812b8519c73ea3dd
BLAKE2b-256 checksum
How to use checksums
82f77c74973bdb9d9ec74bdf8d53d339ed7ae4f3d54fb2f36a74766b5d3f9f35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / llmao_py-0.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL llmao_py-0.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
07c8a5fbaec4126a08e05a9b27e9eb2f0e867b9bc32ee7c27fd860c6a659dc87
BLAKE2b-256 checksum
How to use checksums
a66b4b1feb9ab0c9891128d1189a14e36602ac10e62d028ca1652a781e0bf414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / llmao_py-0.0.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL llmao_py-0.0.1-cp39-abi3-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ccad7edfc1cd773c9ec188ef3933d265103c47a36267b37dc43b04e9ceedd69c
BLAKE2b-256 checksum
How to use checksums
afb996fa5ae5f11e17e361db3111e6fbeafdc0500a4189b1f5e7ce239b6e9c67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / llmao_py-0.0.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL llmao_py-0.0.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3f380da5e57615e6b24691682db92acac22eb80ba1a45d393329487eecdf2f6e
BLAKE2b-256 checksum
How to use checksums
46a1e9548c94bdce6fd2016333793300e93244471d8b546692f2cfeeb4a44cb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page