Skip to content

Olla with docker model runner #80

Closed

Description

@Turboscherbe

Thank you for this great software. I tried to get it running with docker compose and its new model runner. With the following configuration I managed to see the (healthy) endpoint and the available models. But I cannot access the service endpoints from the other end (ollama, openai, ...).

I tried to setup the endpoint with openai-api since docker model runner supports a compatible api (see https://docs.docker.com/ai/model-runner/api-reference/#available-openai-endpoints )

  • Endpoint is running and healthy
  • Models with internal api route /internal/status/models or /olla/models show up
  • Models with external api routes return an empty list (i.e. /olla/openai/v1/models or /olla/llamacpp/v1/models)
  • External api endpoints do not work (404 page not found)

It feels like I'm nearly there, but it seems like I missed something with my config.

## docker-compose.yml ##
services:
  olla:
    image: ghcr.io/thushan/olla:latest
    container_name: olla
    restart: unless-stopped
    ports:
      - "40114:40114"
    volumes:
      - ./olla.yaml:/app/config.yaml:ro
      # - ./logs:/app/logs
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:40114/internal/health"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s
    environment:
      - LOG_LEVEL=info
    models:
      gptoss:
        endpoint_var: GPTOSS_URL
        model_var: GPTOSS_MODEL

models:
  qwen3coder:
    model: ai/qwen3-coder:30B-A3B-UD-Q4_K_XL
    context_size: 30000
#    runtime_flags:
#      - "--n-gpu-layers 1"

For olla I used the default reference config:

## olla.yml ##
server:
  host: "0.0.0.0"
  port: 40114
  read_timeout: 20s
  write_timeout: 0s
  idle_timeout: 120s
  shutdown_timeout: 10s
  request_logging: false
  request_limits:
    max_body_size: 52428800    # 50MB
    max_header_size: 524288     # 512KB
  rate_limits:
    global_requests_per_minute: 0
    per_ip_requests_per_minute: 0
    health_requests_per_minute: 0
    burst_size: 50
    cleanup_interval: 1m
    trust_proxy_headers: false
    trusted_proxy_cidrs: []


proxy:
  engine: "olla"
  profile: "auto"
  load_balancer: "priority"
  connection_timeout: 30s
  response_timeout: 0s
  read_timeout: 0s
  stream_buffer_size: 4096
#  profile_filter:
#    include:
#      - "ollama"        # Include Ollama
#      - "openai*"       # Include all OpenAI variants

translators:
  anthropic:
    enabled: true                   # Enable Anthropic translator
    max_message_size: 10485760     # Max request size (10MB)


discovery:
  type: "static"
  refresh_interval: 5m
  model_discovery:
    enabled: true
    interval: 5m
    timeout: 30s
    concurrent_workers: 5
    retry_attempts: 3
    retry_backoff: 5s
  static:
    endpoints:
      - url: "http://172.17.0.1:12434/engines/llama.cpp/"
        name: "docker-model-loader"
        type: "openai"
        priority: 100
        model_url: "/v1/models"
        health_check_url: "http://172.17.0.1:12434/engines/llama.cpp/v1/models"
        check_interval: 15s
        check_timeout: 10s

model_registry:
  type: "memory"
  enable_unifier: true
  routing_strategy:
    type: "strict"       # strict, optimistic, or discovery
    options:
      fallback_behavior: "all"     # compatible_only, all, or none
      discovery_timeout: 2s
      discovery_refresh_on_miss: false
  unification:
    enabled: true
    stale_threshold: 24h   # Model retention time
    cleanup_interval: 10m  # Cleanup frequency
    cache_ttl: 5m
    custom_rules: []

logging:
  level: "debug"
  format: "text"
  output: "stdout"

So internal endpoints are working fine:

/internal/status/endpoints

{
  "timestamp": "2025-11-05T06:52:26.31293467Z",
  "endpoints": [
    {
      "name": "docker-model-loader",
      "type": "openai",
      "status": "healthy",
      "last_model_sync": "2m ago",
      "health_check": "25s ago",
      "response_time": "2ms",
      "success_rate": "100%",
      "priority": 100,
      "model_count": 2,
      "request_count": 3
    }
  ],
  "total_count": 1,
  "healthy_count": 1,
  "routable_count": 1
}

/olla/models

{
  "object": "list",
  "data": [
    {
      "olla": {
        "family": "",
        "variant": "",
        "parameter_size": "",
        "quantization": "",
        "aliases": [
          "ai/gpt-oss:20B-UD-Q6_K_XL"
        ],
        "availability": [
          {
            "endpoint": "docker-model-loader",
            "state": "unknown"
          }
        ],
        "capabilities": [
          "text-generation"
        ]
      },
      "id": "ai/gpt-oss:20B-UD-Q6_K_XL",
      "object": "model",
      "owned_by": "olla",
      "created": 1762324251
    },
    {
      "olla": {
        "family": "",
        "variant": "",
        "parameter_size": "",
        "quantization": "",
        "aliases": [
          "hf.co/unsloth/qwen3-coder-30b-a3b-instruct-gguf:q4_k_xl"
        ],
        "availability": [
          {
            "endpoint": "docker-model-loader",
            "state": "unknown"
          }
        ],
        "capabilities": [
          "text-generation",
          "code-generation",
          "programming",
          "code-completion",
          "instruction-following",
          "chat"
        ]
      },
      "id": "hf.co/unsloth/qwen3-coder-30b-a3b-instruct-gguf:q4_k_xl",
      "object": "model",
      "owned_by": "olla",
      "created": 1762324251
    }
  ]
}

But external don't:

/olla/openai/v1/models

{
  "object": "list",
  "data": []
}

/olla/openai/v1

404 page not found

How can I get the openai or ollama endpoints up and running?

Best regards
Torsten

Activity

  1. Repository owner deleted a comment from coderabbitai on Nov 5, 2025
  2. self-assigned this
    on Nov 5, 2025
  3. added
    question
    investigating
    llm-backend
    on Nov 5, 2025
  4. Turboscherbe commented on Nov 5, 2025

    @Turboscherbe
    Author

    One additional note: when running the same command against frontend and backend endpoints (both openai), I get the following results:

    curl  {{URL}}  -H "Content-Type: application/json"   -H "Authorization: Bearer my-test-key"   -d '{
        "model": "hf.co/unsloth/qwen3-coder-30b-a3b-instruct-gguf:q4_k_xl",
        "messages": [
          {"role": "system", "content": "Du bist ein hilfreicher Assistent."},
          {"role": "user", "content": "Schreibe ein kurzes Gedicht über den Herbst."}
        ]
      }'



  5. thushan commented on Nov 5, 2025

    @thushan
    Owner

    Hi, thanks for reporting this, I think this may be because we made some last minute changes to the docs and OpenAI usage. Originally we were going to ship with "official OpenAI and Anthropic API" support but later deferred it.

    Are you able to change the type: openai to type: openai-compatible?

    I'm currently overseas and can't check or verify this but will do so in the coming days. Might be a bugfix to the docs I can make (we want to keep openai and anthropic for the official APIs).

  6. Turboscherbe commented on Nov 5, 2025

    @Turboscherbe
    Author

    Are you able to change the type: openai to type: openai-compatible?

    Okay, I changed this.

        endpoints:
          - url: "http://172.17.0.1:12434/engines/llama.cpp/"
            name: "docker-model-loader"
            type: "openai-compatible"    # <-- changed this from openai
            priority: 100
            model_url: "/v1/models"
            health_check_url: "http://172.17.0.1:12434/engines/llama.cpp/v1/models"
            check_interval: 15s
            check_timeout: 10s

    Now I'm getting a model list from

    /olla/openai/v1/models

    {
      "object": "list",
      "data": [
        {
          "id": "hf.co/unsloth/qwen3-coder-30b-a3b-instruct-gguf:q4_k_xl",
          "object": "model",
          "owned_by": "olla",
          "created": 1762338377
        },
        {
          "id": "ai/gpt-oss:20B-UD-Q6_K_XL",
          "object": "model",
          "owned_by": "olla",
          "created": 1762338377
        }
      ]
    }

    But still not able to use the api endpoint /olla/openai/v1/chat/completions --> Error 404

  7. thushan commented on Nov 5, 2025

    @thushan
    Owner

    But still not able to use the api endpoint /olla/openai/v1/chat/completions --> Error 404

    Ah that's our profile matching/routing logic kicking in, apologies I forgot the profile isn't there anymore. I'm sorry to do this to you, but as a work around, can you copy the openai.yaml (in config/profiles) to openai-compatible.yaml.

    Then open both files, in openai.yaml make sure that routing > prefixes that look like this currently:

    # Routing configuration
    routing:
      prefixes:
        - openai
        - openai-compatible

    Only includes the right ones for that profile (so openai.yaml => openai, openai-compatible.yaml => openai-compatible).

    Then make sure the name is also unique.

    Just in case...

    openai.yaml:

    # OpenAI-compatible inference platform profile
    name: openai
    version: "1.0"
    display_name: "OpenAI"
    description: "Generic OpenAI API"
    
    # Routing configuration
    routing:
      prefixes:
        - openai

    openai-compatible.yaml:

    # OpenAI-compatible inference platform profile
    name: openai-compatible
    version: "1.0"
    display_name: "OpenAI Compatible"
    description: "Generic OpenAI-compatible API"
    
    # Routing configuration
    routing:
      prefixes:
        - openai-compatible

    This is a temporary workaround - and hopefully it works. Thank-you for raising it, will release a fix soon and maybe a hotfix.

    Most backends are natively supported so wider testing of OpenAI has dropped in favour of native backend profiles. (which btw, I just noticed you're using llamacpp). You could alternatively use that as your type too type: llamacpp which was added in v0.0.20+.

    I have not used Docker Models yet, but have a feeling I will this weekend now :)

  8. Turboscherbe commented on Nov 5, 2025

    @Turboscherbe
    Author

    Thanks. I copied the config and changed it according to your advice. Now I can use the openai-compatible profile. Models are recogniced in both profiles: openai and openai-compatible. But as soon as trying to use the model with the curl command above, I still get the 404 :(

    In the log files I noticed this line:

    olla  | time=2025-11-05T11:09:34.510Z level=INFO msg="Request dispatching" request_id=woolly-spitting-0da5 endpoint=docker-model-loader target=http://172.17.0.1:12434/completions model=hf.co/unsloth/qwen3-coder-30b-a3b-instruct-gguf:q4_k_xl
    

    It seems that the target is not correct. The endpoint should address the target http://172.17.0.1:12434/engines/llama.cpp/v1/completions, and not target=http://172.17.0.1:12434/completions. Should I add the missing /engines/llama.cpp/v1/ in one of the profile yaml's, too?

  9. thushan commented on Nov 5, 2025

    @thushan
    Owner

    It seems that the target is not correct. The endpoint should address the target http://172.17.0.1:12434/engines/llama.cpp/v1/completions, and not target=http://172.17.0.1:12434/completions. Should I add the missing /engines/llama.cpp/v1/ in one of the profile yaml's, too?

    Hmmm yes good catch! This my friend is a true bug. Because (thus far) most backends are the root and we simply forward/proxy them (also avoids traversals etc). It's something I'll look into deeper tomorrow morning and figure out how we support backends like Docker Models.

    Apologies, hopefully I can get you a fix soon (it'll be a pre-release build).

  10. added
    bug
    documentation
    routing
    and removed
    question
    on Nov 5, 2025
  11. thushan commented on Nov 5, 2025

    @thushan
    Owner

    Good news, I've had a think and I believe we can add a new endpoint configuration item preserve_path to ensure that any endpoint with paths in the URL are preserved when remapping.

    It looks a bit like this:

      # For Docker Model Runners
      endpoints:
        - url: "http://localhost:12434/engines/llama.cpp/"
          name: "docker-model-loader"
          type: "openai-compatible"
          preserve_path: true
    
        - url: "http://192.168.22.187:8010"
          name: "cody-vllm-dev"
          type: "vllm"
          # preserve_path defaults to false if not specified

    Will work through this today and ask some folks from our team to test this (and with Docker Model Registry) and hopefully we can release a fix later today (inclusive of the other changes).

  12. Turboscherbe commented on Nov 6, 2025

    @Turboscherbe
    Author

    Wow, that sounds great. I'm pleased that you are taking care of this so quickly.

    Because (thus far) most backends are the root and we simply forward/proxy them (also avoids traversals etc)

    Sure, we could stick the AI behind a reverse proxy or some url rewrite rules to get a clean and short url. I'm sure that in large environments one would always do so. But in smaller environments like our docker compose stack, the solution with preserve_path sounds perfect.

    Thank you

  13. thushan commented on Nov 6, 2025

    @thushan
    Owner

    Agree, but I think it'll be good to officially support DCR and others like that moving forward - though, have to look deeper into how this works. Probably a bit too hard to implement full DCR support right now - maybe in a couple of weeks.

    However, it will need the fix, so we'll target that.

    Good news is the fix is working - this is just on my laptop btw, nothing fancy and just DCR running GPT-OSS:

    Image

    Correctly detected models etc too:

    Image

    Because they wrap llamacpp, you could set this as either llamacpp or openai-compatible.

    There's a bit of work to do now to run regressions and things (someone else does most of this work) so things are tracking well.

  14. thushan commented on Nov 6, 2025

    @thushan
    Owner

    @Turboscherbe Please update to release v0.0.21 and see how it goes :)

    Feel free to close this issue if it's solved it. Official support for DMR we'll look into later.

  15. Turboscherbe commented on Nov 17, 2025

    @Turboscherbe
    Author

    Thanks. Working perfectly now 👍

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

Metadata

Metadata

Assignees

Labels

bugdocumentationinvestigatingllm-backendrouting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions