AI-native durable workflow engine with built-in LLM cost tracking. Single binary, runs everywhere.
3.4K
AI-native durable workflows that run everywhere
A lightweight, high-performance workflow engine designed for AI applications. Track every token, cache intelligently, and never exceed your LLM budget. Single Rust binary (7.5MB), 63MB Docker image, PostgreSQL as the only dependency.
# Start Kruxia Flow with PostgreSQL and Redis
docker compose up -d
# Or run the image directly (provide your own PostgreSQL)
docker run -d \
-e DATABASE_URL=postgres://user:pass@host:5432/kruxiaflow \
-e KRUXIAFLOW_CLIENT_ID=my-client \
-e KRUXIAFLOW_CLIENT_SECRET=my-secret \
-p 8080:8080 \
kruxia/kruxiaflow:latest serve
For a complete setup with examples:
git clone https://github.com/kruxia/kruxiaflow.git
cd kruxiaflow
./docker up --examples
API docs are available at http://localhost:8080/api/v1/docs.
Kruxia Flow is a durable execution engine — workflows survive crashes, retries are automatic, and state is persistent. It combines workflow orchestration with AI-native features: LLM cost tracking, budget enforcement, multi-provider model fallback, and token streaming.
pip install kruxiaflow| Detail | Value |
|---|---|
| Base Image | distroless/cc-debian12:nonroot |
| Image Size | 63MB |
| Binary Size | 7.5MB |
| Rust Version | 1.90+ |
| Architecture | linux/amd64 |
| User | nonroot (non-root by default) |
The kruxiaflow binary supports multiple subcommands:
| Command | Description |
|---|---|
serve | Start all services (API + Orchestrator + Worker) |
api | Run only the API server |
orchestrator | Run only the orchestrator |
worker | Run only the activity worker |
migrate | Run database migrations |
seed-client | Create OAuth client credentials (idempotent) |
seed-llm | Load LLM pricing catalog |
health | Health check probe |
status | Workflow execution status monitoring |
version | Show version info |
| Variable | Description |
|---|---|
POSTGRES_PASSWORD | PostgreSQL password |
KRUXIAFLOW_CLIENT_ID | OAuth client ID |
KRUXIAFLOW_CLIENT_SECRET | OAuth client secret |
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | (see below) | PostgreSQL connection string |
KRUXIAFLOW_PORT | 8080 | API server port |
KRUXIAFLOW_WORKER_COUNT | 20 | Number of worker threads |
KRUXIAFLOW_CACHE_PROVIDER | redis | Cache backend (redis/memory) |
KRUXIAFLOW_REDIS_URL | — | Redis connection URL |
KRUXIAFLOW_LOG_LEVEL | info | Log level (trace/debug/info/warn/error) |
KRUXIAFLOW_WORKER_POLL_INTERVAL_MS | 100 | Worker poll frequency (ms) |
ANTHROPIC_API_KEY | — | Anthropic API key (for Claude) |
OPENAI_API_KEY | — | OpenAI API key |
GOOGLE_API_KEY | — | Google API key (for Gemini) |
Benchmarked against industry-standard workflow engines (January 2026):
| Metric | Kruxia Flow | Temporal | Airflow |
|---|---|---|---|
| Throughput (wf/sec) | 93 | 66 | 8 |
| P99 Latency | 0.9–1.5s | 0.5–2.7s | 6–22s |
| Peak Memory | 328MB | 425MB | 7.2GB |
| Docker Image | 63MB | ~500MB | ~1GB+ |
name: content_moderation
activities:
- key: moderate
activity_name: llm_prompt
parameters:
model: anthropic/claude-sonnet-4-5-20250929
prompt: "Review this content for policy violations: {{INPUT.content}}"
max_tokens: 500
settings:
budget:
limit_usd: 0.50
action: abort
See the examples directory for 10+ production-ready workflows covering HTTP requests, parallel execution, LLM cost tracking, model fallback, caching, agentic loops, token streaming, and more.
Content type
Image
Digest
sha256:b4b43f857…
Size
14.7 MB
Last updated
about 2 months ago
docker pull kruxia/kruxiaflow