base_url not honored for ollama

Resolved 💬 2 comments Opened Jul 30, 2025 by raokrutarth Closed Aug 18, 2025

What version of Codex is running?

codex-cli 0.0.2505291458

Which model were you using?

ollama

What platform is your computer?

Linux 5.4.0-216-generic x86_64 x86_64

What steps can reproduce the bug?

The ollama base url is hardcoded to port 11434 (https://github.com/openai/codex/blob/6b10e22eb3f999fe2b5c6b8054feefbca791e2bd/codex-rs/core/src/model_provider_info.rs#L263) and doesn't work with any other ports. I need to run ollama on another port (11438) and the codex cli keeps making requests to port 11434

config.toml:

[model_providers.ollama]
name = "Ollama"
base_url = "http://localhost:11438/v1"
wire_api = "chat"

[profiles.ol]
model_provider = "ollama"
model = "mistral-small3.2:latest"
````

### What is the expected behavior?

Honor the base_url  config when invoking ollama

### What do you see instead?

_No response_

### Additional information

Also tried  `OPENAI_BASE_URL="http://localhost:11438/v1" codex exec --profile ol --model mistral-small3.2:latest "follow instructions in ./Task.md"`

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗