Skip to main content

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]
FlagDefaultDescription
--port18790Server port
--host127.0.0.1Bind 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..."
FlagDefaultDescription
--modelautoForce a specific model
--tier(auto)Force a specific tier
--streamtrueStream 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)
FlagDefaultDescription
--ssefalseUse SSE transport instead of stdio
--port18791SSE 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

CodeMeaning
0Success
1General error
2Configuration error (missing API keys, invalid config)
3Connection error (cannot reach provider)