You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provider-neutral LLM orchestration engine with auto-learning
clutch (German: Kupplung) uses a driving metaphor to intelligently route tasks to optimal LLM models across multiple providers. It analyzes task complexity, selects the right model and reasoning level, tracks budgets, and learns from experience.
Features
Provider-neutral -- seamlessly switch between Anthropic (Claude), Google (Gemini), Ollama (local), and Claude Code
Auto-routing -- analyzes task complexity and picks the optimal model + reasoning level
Budget tracking -- four-zone fuel gauge (green/yellow/orange/red) with daily and monthly limits
Learning engine -- fitness scoring and epsilon-greedy exploration that improves routing over time
Execution patterns -- single tasks, chains (convoy), parallel teams, and swarm processing
Health monitoring -- circuit breakers, latency tracking, and provider failover
SQLite metrics -- persistent trip log for analysis and optimization
git clone https://github.com/ellmos-ai/clutch.git
cd clutch
pip install -e .
Requirements
Python 3.10+
API keys for your desired providers (set as environment variables):
ANTHROPIC_API_KEY for Claude models
GOOGLE_API_KEY for Gemini models
Ollama running locally for local models
Quick Start
fromkupplungimportFahrer# Create a driver (uses all configured providers)fahrer=Fahrer()
# Describe your task -- the driver handles everythingresult=fahrer.fahren(
"Fix the authentication bug in the login module",
handler=my_handler,
)
# Inspect what was chosenprint(result.config.gang.name) # "claude-sonnet"print(result.config.gang.provider) # "anthropic"print(result.config.gas.wert) # 0.7# Dashboardstatus=fahrer.status()
print(status["tankuhr"]["zone"]) # "green"print(status["getriebe"]) # "Getriebe[haiku(G1), flash(G2), ...]"# Learn from past runsfahrer.trainieren()
Configuration
All config lives in config/:
File
Purpose
kupplung.json
Global settings (driver defaults, swarm limits, budget)
getriebe.json
All gears + provider mappings
strecken.json
Road type to gear/throttle mapping
fitness_criteria.json
Learning engine thresholds
Budget Zones
Zone
Usage
Allowed Gears
Green
0--30%
All (G1--G5)
Yellow
30--60%
G1--G3
Orange
60--80%
G1--G2 only
Red
80--100%
None (budget exhausted)
Supported Providers
Provider
Models
Local
Anthropic
Claude Haiku, Sonnet, Opus
No
Google
Gemini Flash, Pro
No
Ollama
Qwen, Mistral, and more
Yes
Claude Code
Via subprocess
Yes
Execution Patterns
Single -- one model, one task
Convoy (Kolonne) -- sequential chain, output N feeds input N+1
Team -- parallel specialized workers, results merged
Swarm -- massively parallel micro-tasks (e.g., 20x Haiku), then aggregation
clutch (deutsch: Kupplung) ist eine provider-neutrale LLM-Orchestration-Engine. Das gesamte System nutzt eine durchgaengige Auto-Metapher als Domain Language -- die deutschen Code-Identifier sind bewusst gewaehlt.
Glossar: Code-Begriffe
Deutsch (Code)
Englisch
Beschreibung
Fahrer
Driver
Der Orchestrator -- waehlt Modell, Reasoning-Level und Ausfuehrungsmuster
Strecke
Road / Route
Der Task bzw. die Aufgabe, die analysiert und klassifiziert wird
Getriebe
Gearbox
Die Modell-Registry -- verwaltet alle Gaenge ueber alle Provider
Gang
Gear
Ein konkretes LLM-Modell (G1=Haiku bis G5=Opus)
Kupplung
Clutch
Der Schaltmechanismus -- entscheidet wann und wie zwischen Modellen gewechselt wird
Gas / Bremse
Throttle / Brake
Reasoning-Level: Gas = gruendlicher (mehr Tokens), Bremse = direkter (weniger)
MotorBlock
Engine Block
Die einheitliche API-Aufrufschicht fuer alle Provider
Tacho
Speedometer
Metriken-Erfassung waehrend der Task-Ausfuehrung
Tankuhr
Fuel Gauge
Budget-Tracking mit 4 Zonen (gruen/gelb/orange/rot)
Bordcomputer
Onboard Computer
Health-Monitor mit Circuit-Breaker und Anomalie-Erkennung
Fahrtenbuch
Trip Log
SQLite-basierter Metrik-Speicher fuer alle Fahrten
Fahrschule
Driving School
Lernengine -- optimiert das Routing durch Fitness-Scoring
Streckentypen (Task-Klassifikation)
Strecke
Schwierigkeit
Beispiel
Feldweg
Trivial
Typos, Formatierung, Kommentare
Landstrasse
Standard
Feature-Entwicklung, einfaches Refactoring
Bundesstrasse
Mittel
Bugfixes, Debugging
Autobahn
Hoch
Architektur-Design, System-Migration
Pruefstrecke
Review
Code-Review, Qualitaetspruefung
Rallye
Bulk
Massenformatierung, Batch-Operationen
Konvoi
Pipeline
Sequentielle Verarbeitung (Output N -> Input N+1)
Teamfahrt
Parallel
Multi-File-Features, parallele Spezialisten
Langstrecke
Komplex
Grosse mehrstufige Projekte (Hybrid-Muster)
Testfahrt
Tests
Automatische Test-Generierung
Ausfuehrungsmuster
Muster
Metapher
Beschreibung
Einzelfahrt
Ein Auto
Ein Modell, ein Task
Kolonne
Fahrzeugkolonne
Sequentiell -- Output von Schritt N wird Input fuer N+1