Skip to content

DMR provider ignores integer provider_opts.context_size (YAML integers decode as uint64), so the model starts at its maximum context #4522

Closed

Description

@cat-yyy

Versions: docker-agent v1.142.0 and v1.148.0 (linux/amd64, inside a Docker Sandbox), config version 16, provider dmr (Docker Model Runner on the host, llama.cpp backend), model huggingface.co/unsloth/qwen3.8-27b-gguf:UD-Q4_K_M (context window 262144).

What happens

With

models:
  qwen:
    provider: dmr
    base_url: http://host.docker.internal:12434/engines/v1
    model: huggingface.co/unsloth/qwen3.8-27b-gguf:UD-Q4_K_M
    provider_opts:
      context_size: 64000

the context size never reaches Model Runner, and the model runs with its maximum context (262144).

Debug log (--debug):

msg="DMR provider opts" provider_opts="map[context_size:64000 runtime_flags:[...]]"
msg="DMR provider_opts parsed" ... context_size=<nil> ...
msg="Sending model configure request" ... context_size=<nil> ...
msg="Model configure completed"

GET /engines/_configure afterwards shows no context-size for the model.

Workaround / confirmation

Quoting the value works:

    provider_opts:
      context_size: "64000"

→ Sending model configure request ... context_size=64000, and GET /engines/_configure shows "context-size":64000. Passing --ctx-size 64000 in runtime_flags also works.

Cause (from the source)

parseContextSize → parseInt64Value in pkg/model/provider/dmr/configure.go accepts int64, int, float64 and string, but not uint64. The YAML decoder yields uint64 for a positive integer in a map[string]any, so the value is dropped and parseContextSize returns nil. On main, another numeric parser in the same file already handles uint64, but parseInt64Value does not.

Expected

context_size: 64000 is sent as context-size: 64000. Also, a value that is present but cannot be parsed (and a failed configure request, which is only logged at DEBUG today) could be reported as a warning instead of silently falling back to the model's default context.

Activity

  1. added
    area/providers/docker-model-runner
    area/config
    on Oct 5, 2026
  2. added theissue type on Oct 5, 2026
  3. Webmekanic commented on Oct 6, 2026

    @Webmekanic

    @aheritier is this open for contribution?

  4. aheritier commented on Oct 6, 2026

    @aheritier
    Collaborator

    Sure @Webmekanic especially if you can reproduce the bug and then provide a proper fix with tests

  5. Webmekanic commented on Oct 6, 2026

    @Webmekanic

    Sure @Webmekanic especially if you can reproduce the bug and then provide a proper fix with tests

    Awesome, I will look into this @aheritier

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/configarea/providers/docker-model-runner

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions