Open source · MIT License · Python, Node.js & Rust

AI agents that are
fast and simple to build

Colmena gives you a single, clean API to call any LLM, chain agents into workflows, and deploy anywhere — in just a few lines of code.

~0msbinding overhead
3LLM providers
3languages
MITopen source

Works with all major LLM providers

OpenAI
Google Gemini
Anthropic Claude
Rust core
Python · PyO3
Node.js / TypeScript
Performance

Built with Rust.
Zero overhead.

Colmena's core is written in Rust and compiled directly into native bindings for Python and Node.js. No wrappers, no interpretation layers — just your code at full speed.

0xms
No binding overhead

PyO3 and NAPI-RS compile Rust directly into your runtime. There is nothing in the way between you and the model.

1API
One interface, every provider

Swap between OpenAI, Gemini, and Anthropic by changing a single string. Your logic never changes.

∞
Scale without limits

From a single .call() to complex multi-step pipelines — the same library handles both.

agent.pycolmena-ai
from colmena import ColmenaLlm
import json

llm = ColmenaLlm()

# Synchronous call — simple as it gets
response = llm.call(
    messages=[{"role": "user", "content": "Explain quantum computing."}],
    provider="openai",
    model="gpt-4o",
    temperature=0.7
)
print(response)

# Real-time streaming
for chunk in llm.stream(
    messages=[{"role": "user", "content": "Write a Rust summary."}],
    provider="anthropic",
    model="claude-3-sonnet-20240229"
):
    print(chunk, end="", flush=True)

# Run a full workflow
result = json.loads(colmena.run_dag("workflow.json"))
agent.tscolmena-ai
import { ColmenaLlm, runDag, serveDag } from 'colmena-ai';

const llm = new ColmenaLlm();

// Full TypeScript types — no casting, no @types needed
const response = await llm.call(
  [{ role: 'user', content: 'Describe native bindings.' }],
  'openai',
  { model: 'gpt-4o', temperature: 0.5 }
);

// healthCheck and getProviders built in
const ok = await llm.healthCheck('gemini');

// Execute a full workflow from a JSON file
const result = await runDag('workflow.json');

// Or expose it instantly as a REST endpoint
await serveDag('workflow.json', '0.0.0.0', 3000);
workflow.jsonDAG Engine
{
  "nodes": [
    {
      "id":   "fetch_data",
      "type": "http",
      "url":  "https://api.example.com/data"
    },
    {
      "id":       "analyze",
      "type":     "llm",
      "provider": "gemini",
      "model":    "gemini-2.0-flash"
    },
    {
      "id":     "process",
      "type":   "python",
      "script": "transform.py"
    }
  ],
  "edges": [
    ["fetch_data", "analyze"],
    ["analyze",    "process"]
  ]
}
Simplicity

From zero to working agent in minutes

No SDK setup, no per-provider boilerplate. Install once, call anything.

1
Install the package
One command. Works with pip, npm, or Cargo. No build tools, no configuration files to create.
2
Set your API key
One environment variable per provider. Colmena picks it up automatically — no client initialization code.
3
Call any LLM
A single .call() or .stream() method. Pass messages and a provider name — that's it.
4
Chain into workflows
Define nodes and edges in a JSON file. Call run_dag() to execute the full pipeline in one line.
Without Colmena
pip install openai anthropic google-generativeai
from openai import OpenAI
client = OpenAI(api_key=os.environ[...])
client2 = anthropic.Anthropic(api_key=...)
genai.configure(api_key=...)
# different methods per provider
# custom streaming for each
# custom retry & error handling
# glue code to chain agents...
With Colmena
from colmena import ColmenaLlm
llm = ColmenaLlm()
 
✓ llm.call(..., provider="openai")
✓ llm.call(..., provider="gemini")
✓ llm.call(..., provider="anthropic")
✓ llm.stream(...) for any provider
✓ run_dag("workflow.json")
Features

Everything you need.
Nothing you don't.

The most useful features in the smallest possible API surface. No boilerplate, no learning curve.

⚡
Native performance
Rust core compiled directly into Python and Node.js bindings. Your calls are as fast as a native library can be — no interpreter in the way.
zero overhead
🔀
Sync & streaming
Block for a full response with .call(), or stream tokens live with .stream(). Same interface, your choice, every provider.
.call() · .stream()
🔌
Unified provider API
One consistent interface for OpenAI, Gemini, and Anthropic. Switch models by changing a single string — nothing else in your code changes.
provider="openai"
📊
DAG workflow engine
Chain LLMs, HTTP calls, and Python scripts into multi-step pipelines. Define in JSON, run with one function call — no orchestration framework needed.
run_dag("flow.json")
🌐
Instant REST server
Call serveDag() and your workflow is immediately available as an HTTP endpoint. Connect it to any app with zero extra setup.
serveDag(file, host, port)
🔷
TypeScript native
Full type definitions ship with the package. Autocompletion, inline docs, and compile-time checks out of the box — no extra @types to install.
TypeScript ready
Multi-provider

One SDK.
Every provider.

Change one string and your agent switches providers. No new imports, no new clients, no refactoring.

OpenAI
GPT-4o, GPT-4 Turbo, and the full o-series. Function calling, vision, and real-time streaming — all through the same .call().
Ready to use
provider="openai" model="gpt-4o"
Most tested
Google Gemini
Gemini 2.0 Flash, Pro, and Ultra. Multimodal, long context, and fast inference — same API as every other provider.
Ready to use
provider="gemini" model="gemini-2.0-flash"
Anthropic
Claude 3.5 Sonnet, Haiku, and Opus. Extended thinking, large context windows, and tool use — one unified call.
Ready to use
provider="anthropic" model="claude-3-sonnet-20240229"
Get started

Up and running
in one command

Pick your language. Install. Build.

terminal
$ pip install colmena-ai
# Verify it works
$ python -c "from colmena import ColmenaLlm; print('Ready')"
# Set your provider key and start building
$ export OPENAI_API_KEY=sk-...
terminal
$ npm install colmena-ai
# Full TypeScript types included — no @types needed
$ node -e "const {ColmenaLlm} = require('colmena-ai'); console.log('Ready')"
# Set your provider key and start building
$ export GEMINI_API_KEY=AIza...
Cargo.toml
# Add to [dependencies] in Cargo.toml
colmena = "0.1.0"
$ cargo build --release
# Full type safety at compile time — Rust native
Required environment variables
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...
ANTHROPIC_API_KEY=sk-ant-...

Ready to build your
AI agents at native speed?

Colmena is open source, MIT licensed, and built by the Startti team. Start for free — no credit card, no setup, just code.