( *^-^)p ~ smart routing ~ cost optimization ~ multi-provider ~ q(^-^* )
"From Cost Optimization to Intelligent Orchestration" ~(^-^~)
FreeClaw manages your AI API keys, monitors costs, and automatically routes tasks to the cheapest available model — saving you 30-90% on API spending.
+-----------+
Your App ------> | FreeClaw | ------> OpenAI
Claude Code | Hub | ------> Anthropic
Any Client | (routing) | ------> Google
| (^_^) | ------> DeepSeek
+-----------+ ------> 40+ more...
AI complexity prediction auto-selects the tier! |
|
Auto-fallback, zero downtime. |
|
# Standalone (no OpenClaw needed!)
git clone https://github.com/2233admin/freeclaw.git
cd freeclaw
pip install -r requirements.txt
# Or install as package
pip install . # core only
pip install ".[tui]" # + beautiful TUI
pip install ".[mesh]" # + Redis cluster support
pip install ".[tui,mesh]" # everything! (>w<)As OpenClaw Skill (click to expand)
# If you have OpenClaw installed, FreeClaw auto-detects it
# Config priority:
# $FREECLAW_CONFIG > ~/.openclaw/openclaw.json > ~/.freeclaw/freeclaw.json# Health check
python lib/cost_monitor.py health
# Launch TUI with startup animation
python clawapi-rich.py
# Route a task (returns best model)
python lib/smart_router.py route "translate hello to Japanese"
# Switch primary model
python lib/model_switcher.py list
python lib/model_switcher.py switch 3./clawapi status # Full status overview
./clawapi providers # List all providers
./clawapi models # List all models
./clawapi set-primary deepseek/deepseek-chat
./clawapi add-fallback minimax/MiniMax-M2.5
./clawapi validate # Check config health ______ _____ _
| ____| / ____| |
| |__ _ __ ___ ___| | | | __ ___ __
| __| '__/ _ \/ _ \ | | |/ _` \ \ /\ / /
| | | | | __/ __/ |____| | (_| |\ V V /
|_| |_| \___|\___|\_____|_|\__,_| \_/\_/
API Hub for 40+ AI Providers
ok Config openclaw.json
ok Providers 2 loaded
ok Primary claude-proxy/claude-sonnet-4
ok Fallbacks 0 models
ok Router ready
ok Breaker ready
2 providers | 4 models | 0 fallbacks
| Task | Example | Before | After | Savings |
|---|---|---|---|---|
| Simple | "what time is it?" | $0.015 | $0.00 | 100% |
| Medium | "summarize this PR" | $0.30 | $0.10 | 67% |
| Complex | "architect a microservice" | $1.50 | $1.50 | 0% |
Average savings: 30-90% depending on task mix (o^-^o)b
freeclaw/
├── clawapi # Unified CLI entrypoint
├── clawapi-rich.py # Rich TUI (with startup animation!)
├── clawapi-tui.py # Textual TUI (full interactive)
│
├── lib/
│ ├── constants.py # Config path resolution
│ ├── config_manager.py # Provider/model/fallback management
│ ├── model_switcher.py # Safe model switching
│ ├── smart_router.py # Three-tier intelligent routing
│ ├── cost_monitor.py # Usage tracking & reports
│ ├── circuit_breaker.py # Provider health & auto-fallback
│ ├── provider_adapter.py # Unified provider adapter
│ ├── builtin_providers.py # 40+ provider templates
│ ├── ai_complexity_predictor.py # AI task analysis
│ └── mesh_bridge.py # FSC-Mesh Redis bridge
│
├── .claude-plugin/ # Claude Code plugin metadata
├── skills/freeclaw/ # OpenClaw skill definition
├── config/ # Configuration templates
└── data/ # Runtime data
$FREECLAW_CONFIG # env var (highest priority)
└─> ~/.openclaw/openclaw.json # OpenClaw integration
└─> ~/.freeclaw/freeclaw.json # standalone (auto-created)
Common issues
See TROUBLESHOOTING.md for:
- Protocol mismatch errors
- Config file corruption recovery
- API key expiration detection
- Circuit breaker status
Project Board ~ tracking all tasks
| # | Task | Status |
|---|---|---|
| #1 | typer CLI 统一入口 (claw hub status/keys/cost/route) |
🔲 Todo |
| #2 | 统一配置管理 (~/.claw/config.toml) |
🔲 Todo |
| # | Task | Status |
|---|---|---|
| #3 | OpenAI-compatible HTTP proxy (/v1/chat/completions) |
🔲 Todo |
| #4 | 流式响应 + SSE 透传 | 🔲 Todo |
| #5 | 熔断器 + 自动降级链 (Claude → DeepSeek → Doubao → Ollama) | 🔲 Todo |
| #7 | 用量仪表盘 + 超预算报警 | 🔲 Todo |
| # | Task | Status |
|---|---|---|
| #6 | mesh_bridge 集群路由共享 (Redis 同步) | 🔲 Todo |
密钥管理器 ──→ 统一 AI Gateway ──→ 分布式路由集群
(v1.x) (v2.0) (v3.0)
Goal: 所有 AI 调用的唯一出口,CLI-first,agent-native。
made with mass mass love by mass mass people ~(=^-^)ノ