Skip to content

Cant use local openweights model through ollama + litellm in codex-cli #21979

@ACodingfreak

Description

@ACodingfreak

What version of Codex CLI is running?

codex-cli 0.130.0

What subscription do you have?

NA

Which model were you using?

openweights model /devstral:24b under ollama

What platform is your computer?

Ubuntu 22.04

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

As shown below on running any requests I end up seeing a command to be executed but not the expected result

$ codex --profile remote
╭───────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.130.0)                        │
│                                                   │
│ model:     ollama/devstral:24b   /model to change │
│ directory: ~/workspace                            │
╰───────────────────────────────────────────────────╯

  Tip: You can resume a previous conversation by running codex resume


› create a python file with logic to support singly linked list


⚠ Model metadata for `ollama/devstral:24b` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.

• {"name": "exec_command", "arguments":{"cmd": "find /home/ipi/workspace -type f -name "*.py" | grep -i 'linked'", "justification": "", "login": true,
  "max_output_tokens": 1000}}

What steps can reproduce the bug?

As mentioned in description. Find the respective cofnig file as shown below

cat ~/.codex/config.toml
model = "ollama/devstral:24b"
model_provider = "litellm_remote"

[model_providers.litellm_remote]
name = "Remote LiteLLM"
base_url = "http://10.30.0.103:4000/v1"
env_key = "LITELLM_API_KEY"
wire_api = "responses"

[profiles.remote]
model_provider = "litellm_remote"
model = "ollama/devstral:24b"

[projects."/home/ip/workspace"]
trust_level = "trusted"

[tui]
status_line = ["current-dir", "model", "project-name"]
status_line_use_colors = true

[tui.model_availability_nux]
"gpt-5.5" = 4

What is the expected behavior?

Ideally i should be able to use openweight models with codex-cli

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcustom-modelIssues related to custom model providers (including local models)tool-callsIssues related to tool calling

    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