Skip to content

Ollama API compatibility issue for model name (model not found + wrong provider) #3051

@Noobzik

Description

@Noobzik

Context :

  • Using claw-code with a local model through Ollama.
  • Compiled claw-code from the source file using the provided documentation

Set the variable name in powershell as required for ollama

$env:OPENAI_BASE_URL = "http://127.0.0.1:11434/v1"
$env:OPENAI_API_KEY = "sk-local-ollama"   # dummy, Ollama will ignore it
  • Error log by adding the name of the provider before the model name :
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> $env:OPENAI_BASE_URL = "http://127.0.0.1:11434/v1"
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> $env:OPENAI_API_KEY = "sk-local-ollama"   # dummy, Ollama will ignore it
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> Remove-Item Env:\ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> Remove-Item Env:\ANTHROPIC_AUTH_TOKEN -ErrorAction SilentlyContinue
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> .\claw.exe --model "ollama/qwen2.5-coder:7b" prompt "hi"
✘ ❌ Request failed
[error-kind: api_http_error]
error: api returned 404 Not Found (not_found_error): model 'ollama/qwen2.5-coder:7b' not found
  • Error log by removing the provider name before the model name :
PS C:\Users\XXX\Documents\git\claw-code\rust\target\debug> .\claw.exe --model "qwen2.5-coder:7b" prompt "hi"
[error-kind: invalid_model_syntax]
error: invalid model syntax: 'qwen2.5-coder:7b'. Expected provider/model (e.g., anthropic/claude-opus-4-6) or known alias (opus, sonnet, haiku)
Did you mean `qwen/qwen2.5-coder:7b`? (Requires DASHSCOPE_API_KEY env var)

Run `claw --help` for usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions