> ## Documentation Index
> Fetch the complete documentation index at: https://noorle.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Routing

> Choose how AI models are selected for agent runs. Smart routing vs specific model selection with budget models.

Model routing determines which AI model handles requests to your agents and gateways. Noorle supports two strategies: Smart Routing (platform-managed) and Specific Model selection (user-controlled).

## Routing Strategies

### Smart Routing (Recommended for Most)

The platform automatically selects the best model for each request based on:

* Request complexity and characteristics
* Available tier and provider constraints
* Real-time model performance and availability

**Best for:**

* Maximizing cost-efficiency automatically
* Leveraging platform's model optimization
* Not worrying about specific model selection

**Configuration:**

```json theme={null}
{
  "routing_strategy": {
    "strategy": "smart",
    "tier": null,
    "provider": null,
    "use_case": null
  }
}
```

You can optionally constrain:

* **Tier** - Always use Budget/Standard/Advanced tier
* **Provider** - Restrict to OpenAI, Anthropic, or other provider
* **Use Case** - Hint toward specific category (Fast, Reasoning, Code, Creative)

### Specific Model

You explicitly choose which model(s) to use. Optionally specify a budget model for cost optimization.

**Best for:**

* Consistent, reproducible behavior
* Using a specific model's strengths
* Cost control with budget models

**Configuration:**

```json theme={null}
{
  "routing_strategy": {
    "strategy": "specific",
    "model_name": "gpt-5.1",
    "settings": {
      "temperature": 0.7,
      "max_tokens": 2048
    },
    "budget_model": "gpt-4o-mini",
    "budget_model_settings": {
      "temperature": 0.5,
      "max_tokens": 1024
    },
    "fallback": true
  }
}
```

## Supported Providers

### OpenAI

* **Models**: gpt-5.1, gpt-5, gpt-4.5-turbo, gpt-4o, gpt-4o-mini, and more
* **Best for**: Broad capabilities, strong reasoning
* **Cost**: Standard to Premium pricing

### Anthropic

* **Models**: claude-sonnet-4-5-20250929, claude-opus-4-1-20250805, claude-3.5-sonnet, and more
* **Best for**: Long context, nuanced reasoning
* **Cost**: Competitive with extended context pricing

### Other Providers

Available depending on your account configuration. Check your model catalog in Console.

## Model Tiers

Tiers help classify models by capability and cost:

| Tier         | Cost    | Capabilities                     | Examples                  |
| ------------ | ------- | -------------------------------- | ------------------------- |
| **Budget**   | Lowest  | Fast responses, simple tasks     | gpt-4o-mini, claude-haiku |
| **Standard** | Medium  | Balanced speed and capability    | gpt-4o, claude-sonnet     |
| **Advanced** | Highest | Complex reasoning, large context | gpt-5.1, claude-opus      |

## Budget Models

A budget model is a cheaper alternative the platform uses for simple requests, automatically detected per-request:

**Benefits:**

* Reduce costs on simple tasks without changing code
* Primary model handles complex reasoning
* Seamless fallback when budget model insufficient

**Requirements:**

* Must be same provider as primary model
* Usually a tier lower (e.g., Standard primary + Budget secondary)

**Example:**

```json theme={null}
{
  "model_name": "claude-sonnet-4-5",
  "budget_model": "claude-haiku-4-5"
}
```

The platform analyzes each request and sends simple ones to claude-haiku, complex ones to claude-sonnet.

## Model Settings

Per-model configuration for fine-grained control:

```json theme={null}
{
  "settings": {
    "temperature": 0.7,
    "top_p": 0.95,
    "max_tokens": 2048,
    "frequency_penalty": 0.0,
    "presence_penalty": 0.0
  }
}
```

### Parameters

| Parameter              | Range       | Default       | Effect                             |
| ---------------------- | ----------- | ------------- | ---------------------------------- |
| **temperature**        | 0.0-2.0     | 0.7           | Randomness (lower = deterministic) |
| **top\_p**             | 0.0-1.0     | 0.95          | Nucleus sampling threshold         |
| **max\_tokens**        | 1-512K      | Model default | Maximum output length              |
| **frequency\_penalty** | -2.0 to 2.0 | 0.0           | Reduce repetition                  |
| **presence\_penalty**  | -2.0 to 2.0 | 0.0           | Encourage new topics               |

## Fallback Behavior

When **fallback** is enabled (default), the platform automatically switches to an alternative model if your chosen model becomes unavailable.

**Fallback rules:**

* Stays within same provider (no cross-provider fallback)
* Respects tier constraints from Smart routing
* Maintains same model settings

**Disable fallback** if you need exact model consistency (not recommended for production).

## Setting Model Routing

### In Console (Agents)

1. Go to **Agents** > Select Agent
2. Click **Settings** > **Model Configuration**
3. Choose **Smart Routing** or **Specific Model**
4. Configure options (tier, provider, budget model, etc.)
5. Click **Save**

### In Console (MCP Gateways)

MCP Gateways use Smart Routing by default. Override by editing gateway specifications:

1. Go to **Gateways** > Select Gateway
2. Click **Specifications**
3. Add `model_routing` section
4. Click **Save**

### Via API

```bash theme={null}
# Update agent model routing
curl -X PATCH https://api.noorle.com/v1/agents/{agent_id} \
  -H "X-API-Key: ak-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "specifications": {
      "routing_strategy": {
        "strategy": "specific",
        "model_name": "gpt-5.1",
        "fallback": true
      }
    }
  }'
```

## Cost Optimization Tips

### Use Smart Routing for Auto-Optimization

Let Noorle's platform choose the best model per-request automatically.

### Pair Primary + Budget Model

Use a high-capability primary with a low-cost budget model:

```json theme={null}
{
  "model_name": "claude-sonnet-4-5",
  "budget_model": "claude-haiku-4-5"
}
```

### Monitor Token Usage

Check your usage dashboard to see which models you're using and costs incurred.

### Use Constrained Smart Routing

Pin to a specific tier but let platform choose within it:

```json theme={null}
{
  "strategy": "smart",
  "tier": "Standard"
}
```

## Troubleshooting

### Model Not Found

Check that the model name is spelled correctly and available in your region/account.

### High Cost Despite Budget Model

Budget model might not be triggering due to request complexity. Review cost analysis in usage dashboard.

### Model Unavailable Errors

Fallback is disabled or fallback models are also unavailable. Enable fallback or add alternative models.

### Inconsistent Behavior

You're on Smart Routing. Switch to Specific Model for consistent behavior, though you'll lose auto-optimization.

## Next Steps

* [Create Agents](/docs/use/agents/creating-an-agent)
* [Configure Agent System Prompts](/docs/use/agents/system-prompts)
* [Monitor Usage and Costs](/docs/use/platform/usage-and-limits)
