home/ecommerce/adr-011-dynamic-routing-prompt

Adr 011 Dynamic Routing Prompt

GPTClaudeGemini··1,384 copies·updated 2026-07-14
adr-011-dynamic-routing-prompt.prompt
# ADR-011: Dynamic Router Prompt

## Status

Accepted (2025-Q4)

## Context

ClawAI's AUTO routing mode uses a local Ollama model to classify user messages and select the best AI provider/model. Initially, the router prompt was a static template listing all available models and their capabilities.

This static approach broke down as the model catalog grew:

- When a user installed a new coding model, the router did not know about it
- When a model was deleted, the router still tried to route to it, causing failures
- Adding a new model category required updating the prompt template manually
- The prompt listed models that were not installed, wasting tokens and confusing the router

## Decision

Build the router prompt dynamically at runtime based on the currently installed and healthy models. The `PromptBuilderManager` in the routing service fetches installed models from the ollama-service internal API, groups them by category, and constructs the routing prompt.

### Architecture

when to use it

Community prompt sourced from the open-source GitHub repo ihabkhaled/ClawAI (Apache-2.0). A "Adr 011 Dynamic Routing Prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

ecommercecommunitygeneral

source

ihabkhaled/ClawAI · Apache-2.0