Skip to content

Router Configuration

Environment Variables

VariableDefaultDescription
ROUTER_PORT50052gRPC server port
BRAIN_HOSTlocalhost:50051ContextBrain gRPC address
SHIELD_HOSTContextShield gRPC address (optional)
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
GOOGLE_PROJECT_IDGoogle Cloud project for Vertex AI
GROQ_API_KEYGroq API key
PERPLEXITY_API_KEYPerplexity API key
DEFAULT_LLMopenai/gpt-5-miniDefault LLM provider
DEBUG_PIPELINE0Enable pipeline debug logs
DEBUG_WEB_SEARCH0Enable web search debug logs

Agent Configuration

Agents are configured via AgentConfig objects stored in ContextView’s database. Each agent specifies:

  • LLM provider — which model to use
  • Allowed tools — which tools the agent can invoke
  • System prompt — base personality and instructions
  • Temperature — LLM temperature setting
  • Fallback models — backup providers if primary fails

Running

Terminal window
# Start gRPC server
uv run python -m contextrouter
# With custom port
ROUTER_PORT=50099 uv run python -m contextrouter