Skip to content

Bug: strict model routing is bypassed when an alias resolves to no endpoints #191

Closed

Description

@skaravos

Preflight checks

  • I have searched existing issues and this is not a duplicate
  • I am running a recent release or a build from main

What happened?

Summary

When model_registry.routing_strategy.type is set to strict or model_registry.routing_strategy.options.fallback_behaviour is none, unknown models correctly fail fast with a 404.

However, if the requested model matches a configured model_aliases entry whose
target model does not exist on any endpoint, Olla logs a rejected routing
decision but still proxies the request to a compatible endpoint.

Expected behaviour

The request should fail fast, like any other unavailable model under strict routing, ideally with 404 and routing_action: rejected.

Actual behaviour

Olla logs:

WARN Model alias resolved to no endpoints, falling back to standard routing

Then strict routing appears to reject the alias (i.e. routing_action: rejected), but the request is still proxied and returns a real backend response to the client request with HTTP 200.

...
2026-06-29 10:26:07 INFO  Request completed
                      ├ request_id: woolly-galloping-ce66
                      ├ duration_ms: 4369
                      ├ status: completed
                      ├ model: fake
                      ├ input_tokens: 25
                      ├ output_tokens: 200
                      ├ total_tokens: 225
                      ├ routing_action: rejected
                      ├ endpoint: local-llama-q4
                      ├ total_bytes: 1447
                      ├ provider_model: qwen3.5
                      ├ routing_strategy: strict
                      └ routing_reason: model_not_found
...

Steps to reproduce

Configure Olla with strict routing, none as fallback behaviour and a model
alias that has no routable models.

model_registry:
  routing_strategy:
    type: "strict"
    options:
      fallback_behavior: "none"

# ...

model_aliases:
  fake:
    - "this-is-not-a-real-model-on-any-endpoints"

Attempt a chat request that specifies the unroutable alias:

{
  "model": "fake",
  "messages": [{ "role": "user", "content": "What is your name?" }],
  "stream": false
}

Proxy engine

Olla (default)

How are you running Olla?

Built from source

Backend(s) involved

Not backend specific

Configuration

model_registry:
  routing_strategy:
    type: "strict"
    options:
      fallback_behavior: "none"

# ...

model_aliases:
  fake:
    - "this-is-not-a-real-model-on-any-endpoints"

Relevant log output

2026-06-29 10:26:03 DEBUG HTTP request started
                      ├ request_size_formatted: 238B
                      ├ request_id: woolly-galloping-ce66
                      ├ method: POST
                      ├ path: /olla/openai/v1/chat/completions
                      ├ remote_addr: 127.0.0.1:43596
                      ├ user_agent: curl/8.14.1
                      └ request_bytes: 238
2026-06-29 10:26:03 DEBUG Proxy handler called
                      ├ path: /olla/openai/v1/chat/completions
                      ├ method: POST
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:03 DEBUG Path inspection completed (exact match)
                      ├ path: /v1/chat/completions
                      └ supported_profiles: [litellm llamacpp lm-studio lmdeploy ollama omlx sglang vllm vllm-mlx openai-compatible]
2026-06-29 10:26:03 DEBUG Inspector completed
                      ├ inspector: path
                      ├ path: /v1/chat/completions
                      └ supported_by: [litellm llamacpp lm-studio lmdeploy ollama omlx sglang vllm vllm-mlx openai-compatible]
2026-06-29 10:26:03 DEBUG Extracted model name from request body model: fake
2026-06-29 10:26:03 DEBUG Inspector completed
                      ├ inspector: body
                      ├ path: /v1/chat/completions
                      └ supported_by: [litellm llamacpp lm-studio lmdeploy ollama omlx sglang vllm vllm-mlx openai-compatible]
2026-06-29 10:26:03 DEBUG Filtered endpoints by profile compatibility
                      ├ path: /v1/chat/completions
                      ├ compatible_count: 2
                      ├ total_count: 2
                      ├ supported_by: [openai-compatible docker-model-runner lemonade litellm llamacpp lm-studio lmdeploy ollama omlx sglang vllm vllm-mlx]
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:03 DEBUG Filtered endpoints by profile compatibility
                      ├ compatible_count: 2
                      ├ total_count: 2
                      ├ supported_by: [litellm llamacpp lm-studio lmdeploy ollama omlx sglang vllm vllm-mlx openai-compatible]
                      ├ request_id: woolly-galloping-ce66
                      └ path: /v1/chat/completions
2026-06-29 10:26:03 WARN  Model alias resolved to no endpoints, falling back to
                      │   standard routing
                      ├ alias: fake
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:03 DEBUG Model not found in any endpoint
                      ├ model: fake
                      └ healthy_endpoints: 2
2026-06-29 10:26:03 INFO  Request received
                      ├ content_length: 238
                      ├ request_id: woolly-galloping-ce66
                      ├ client_ip: 127.0.0.1
                      ├ method: POST
                      ├ path: /olla/openai/v1/chat/completions
                      ├ compatible_endpoints: 2
                      ├ user_agent: curl/8.14.1
                      └ model: fake
2026-06-29 10:26:03 DEBUG Request details
                      ├ target_path: /v1/chat/completions
                      ├ path_resolution_ms: 0
                      ├ query:
                      ├ content_type: application/json
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:03 DEBUG Olla proxy request started
                      ├ method: POST
                      ├ url: /v1/chat/completions
                      ├ endpoint_count: 2
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:03 INFO  Request dispatching
                      ├ target: http://127.0.0.1:6004/v1/chat/completions
                      ├ model: fake
                      ├ request_id: woolly-galloping-ce66
                      └ endpoint: local-llama-q4
2026-06-29 10:26:03 DEBUG making round-trip request
                      ├ target: http://127.0.0.1:6004/v1/chat/completions
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:07 DEBUG round-trip success
                      ├ status: 200
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:07 DEBUG starting response stream
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:07 DEBUG Metrics extracted
                      ├ engine: Olla
                      ├ tokens: 225
                      └ request_id: woolly-galloping-ce66
2026-06-29 10:26:07 DEBUG Olla proxy metrics
                      ├ backend_ms: 4367
                      ├ first_data_ms: 4368
                      ├ streaming_ms: 0
                      ├ output_tokens: 200
                      ├ provider_model: qwen3.5
                      ├ endpoint: local-llama-q4
                      ├ header_ms: 0
                      ├ total_bytes: 1447
                      ├ input_tokens: 25
                      ├ total_tokens: 225
                      ├ finish_reason: length
                      ├ request_id: woolly-galloping-ce66
                      ├ processing_ms: 0
                      ├ selection_ms: 0
                      ├ bytes_formatted: 1.4KB
                      ├ latency_ms: 4368
                      └ status: 200
2026-06-29 10:26:07 INFO  Request completed
                      ├ request_id: woolly-galloping-ce66
                      ├ duration_ms: 4369
                      ├ status: completed
                      ├ model: fake
                      ├ input_tokens: 25
                      ├ output_tokens: 200
                      ├ total_tokens: 225
                      ├ routing_action: rejected
                      ├ endpoint: local-llama-q4
                      ├ total_bytes: 1447
                      ├ provider_model: qwen3.5
                      ├ routing_strategy: strict
                      └ routing_reason: model_not_found
2026-06-29 10:26:07 DEBUG Request metrics
                      ├ client_ip: 127.0.0.1
                      ├ total_bytes: 1447
                      ├ streaming_ms: 0
                      ├ path_resolution_ms: 0
                      ├ provider_model: qwen3.5
                      ├ request_id: woolly-galloping-ce66
                      ├ endpoint: local-llama-q4
                      ├ duration_ms: 4369
                      ├ backend_response_ms: 4367
                      ├ header_processing_ms: 0
                      ├ selection_ms: 0
                      ├ total_tokens: 225
                      ├ model: fake
                      ├ latency_ms: 4368
                      ├ request_processing_ms: 0
                      ├ input_tokens: 25
                      ├ finish_reason: length
                      ├ first_data_ms: 4368
                      └ output_tokens: 200
2026-06-29 10:26:07 DEBUG HTTP request completed
                      ├ size_flow: 238B -> 1.4KB
                      ├ request_id: woolly-galloping-ce66
                      ├ method: POST
                      ├ duration_formatted: 4.370139833s
                      ├ path: /v1/chat/completions
                      ├ status: 200
                      ├ duration_ms: 4370
                      ├ request_bytes: 238
                      └ response_bytes: 1447

Olla version

v1.24.4@a595ca7

Platform

Linux (amd64)

Activity

  1. added
    bug
    on Jun 29, 2026
  2. self-assigned this
    on Jul 2, 2026
  3. added
    investigating
    work in progress
    and removed
    investigating
    on Jul 2, 2026
  4. thushan commented on Jul 2, 2026

    @thushan
    Owner

    Thanks for reporting this, reproduced and working on a fix. As you built from source, might let you know the branch to test when we're read.

  5. thushan commented on Jul 8, 2026

    @thushan
    Owner

    Think i've got a fix for this, we're just testing it doesn't break some other areas and will let you know the branch soon.

  6. thushan commented on Jul 18, 2026

    @thushan
    Owner

    @skaravos apologies mate, the testing took time and came up with some issues which we've addressed today.

    The branch for you to test: bugfix/191-strict-model-routing-bypass

    We hope to release a new version of Olla in late July or early August, hopefully you can signoff before it closes.

  7. skaravos commented on Jul 20, 2026

    @skaravos
    Author

    Looks good. I rebuilt on the branch and at least on my setup it does seem to be fixed.

    I see that Olla now also sets the X-Olla-Routing-Decision and X-Olla-Routing-Reason headers in the response too, which is a bonus.

    Thanks!

  8. skaravos commented on Jul 20, 2026

    @skaravos
    Author

    I guess I may have been a bit too hasty to mark the issue closed as you haven't actually merged it into main yet, but at least from my POV as someone building from source I consider this issue solved.

  9. added
    resolved
    and removed
    work in progress
    on Jul 20, 2026
  10. thushan commented on Jul 20, 2026

    @thushan
    Owner

    it's incentive to merge :) done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugresolved

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions