CLI Reference
LARouter includes a command-line interface for administration, testing, and model management.
Installation
The CLI is available as larouter when installed globally, or via bun run from the backend directory:
# From the backend directory
cd LARouter/backend
bun run src/cli.ts <command>
# Or with global install
larouter <command>
Commands
larouter start
Start the LARouter server.
larouter start [--port 18790] [--host 0.0.0.0]
| Flag | Default | Description |
|---|---|---|
--port | 18790 | Server port |
--host | 127.0.0.1 | Bind address |
larouter test
Send a test prompt through the router.
larouter test "What is the capital of France?"
larouter test --model gemma-4-e4b "Summarize this document"
larouter test --tier COMPLEX "Analyze the performance of..."
| Flag | Default | Description |
|---|---|---|
--model | auto | Force a specific model |
--tier | (auto) | Force a specific tier |
--stream | true | Stream the response |
larouter models
List registered models and their status.
larouter models # List all models
larouter models download gemma4-e4b gguf # Download a model
larouter models start gemma4-e4b # Start llama-server
larouter models stop gemma4-e4b # Stop llama-server
larouter models health # Health check all running models
larouter projects
Manage multi-tenant projects.
larouter projects list # List all projects
larouter projects create my-app # Create project + token
larouter projects delete my-app # Delete project
larouter projects usage my-app # Show usage for project
larouter usage
View usage statistics.
larouter usage # Overall summary
larouter usage --period weekly # Weekly breakdown
larouter usage --project my-app # Per-project usage
larouter usage --export csv # Export to CSV
larouter mcp
Start the MCP (Model Context Protocol) tool server.
larouter mcp # stdio transport (for AI editors)
larouter mcp --sse # SSE transport on port 18791 (for web clients)
| Flag | Default | Description |
|---|---|---|
--sse | false | Use SSE transport instead of stdio |
--port | 18791 | SSE server port |
larouter config
View or update runtime configuration.
larouter config show # Show current config (keys redacted)
larouter config set tier.simple gemma-4-e4b # Override tier mapping
Environment Variables
The CLI respects all configuration environment variables. You can also pass them inline:
GOOGLE_API_KEY=xxx larouter start
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Configuration error (missing API keys, invalid config) |
3 | Connection error (cannot reach provider) |