|
|
1 tháng trước cách đây | |
|---|---|---|
| model_selector | 1 tháng trước cách đây | |
| tests | 1 tháng trước cách đây | |
| .codex | 1 tháng trước cách đây | |
| .gitignore | 1 tháng trước cách đây | |
| AGENTS.md | 1 tháng trước cách đây | |
| README.md | 1 tháng trước cách đây | |
| killserver.sh | 2 tháng trước cách đây | |
| restart.sh | 2 tháng trước cách đây | |
| run.sh | 2 tháng trước cách đây |
A FastAPI dashboard for browsing and editing the model/provider configuration in ~/.openclaw/openclaw.json.
.cache/ for offline browsinggpt-4o → "osiris")openclaw.json# Copy env template and add your API keys
cp .env.example .env
# Edit .env with your OPENAI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY
# Start the server (defaults to port 3300)
./run.sh
# Or with custom port
MODEL_SELECTOR_PORT=8080 ./run.sh
Open http://localhost:3300 in your browser.
| Variable | Default | Description |
|---|---|---|
OPENAI_API_KEY |
— | OpenAI API token |
GROQ_API_KEY |
— | Groq API token |
OPENROUTER_API_KEY |
— | OpenRouter API token |
OPENCLAW_CONFIG_PATH |
~/.openclaw/openclaw.json |
Path to your OpenClaw config |
MODEL_SELECTOR_PORT |
3300 |
Dashboard server port |
MODEL_SELECTOR_REFRESH_INTERVAL |
1800 |
Provider refresh interval (seconds) |
MODEL_SELECTOR_CACHE_DIR |
data/model-cache |
Cache directory for provider snapshots |
The dashboard reads from /home/lucky/.openclaw/openclaw.json by default. This file uses the OpenClaw schema:
{
"models": {
"providers": {
"openai": {
"models": [
{"id": "gpt-4o", "name": "GPT-4o", "reasoning": false, "input": ["text"], "contextWindow": 128000, "maxTokens": 16000}
]
}
}
},
"agents": {
"defaults": {
"models": {
"openai/gpt-4o": {"alias": "my-favorite"}
}
}
}
}
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Dashboard UI |
/api/state |
GET | Full dashboard state (configured + providers) |
/api/config |
GET | Config path and configured models |
/api/alias |
POST | Update model alias ({full_key, alias}) |
/api/config/models/add |
POST | Add model to config ({provider_key, model_id}) |
/api/config/models/delete |
POST | Remove model from config ({full_key}) |
/api/refresh |
POST | Force provider refresh |
# Uses temp config fixtures; never touches the live file
python -m pytest tests/ -v
.
├── model_selector/
│ ├── main.py # FastAPI app, routes
│ ├── config.py # OpenClawConfigRepository
│ ├── providers.py # ProviderAdapter, feature detection
│ ├── service.py # ModelDashboardService
│ ├── cache.py # SnapshotCache
│ ├── settings.py # AppSettings from env
│ └── ui.py # Jinja2-style HTML rendering
├── data/model-cache/ # Provider snapshots (gitignored)
├── tests/
├── run.sh # Start server
├── restart.sh # Kill + start
└── killserver.sh # Clear port 3300
| Provider | Key | Features |
|---|---|---|
| OpenAI | openai |
reasoning, context_window, max_tokens |
| Groq | groq-cloud |
reasoning, context_window, active status |
| OpenRouter | openrouter |
pricing (prompt/completion/request), full metadata |
Missing capabilities display as "—" rather than being invented.
MIT