Codex

Set Up Codex Desktop with Custom Models Using Prism

By Kavin M KPublished Updated 8 min read

Quick answer
Click Setup for Codex in Prism's Agents tab, then restart Codex. Prism writes a managed provider block and a model catalog into ~/.codex/config.toml. Codex then lists every Prism model with its real context window and reasoning levels, and which model is selected stays your choice.

Codex Desktop is OpenAI's native coding agent application. It has a clean model picker that lets you select which model to use — but by default it only shows OpenAI's own models. If you want to use DeepSeek, Llama, GLM, or any other non-OpenAI model, the picker offers no way to add them.

Prism fixes this by injecting custom models directly into Codex Desktop's native model selector. After a one-time setup, your models appear in the picker, each marked as running through Prism, and Prism keeps them synchronized automatically.

How it works

Codex Desktop reads its model configuration from a TOML file at ~/.codex/config.toml. This file contains provider blocks that define which models are available and how to reach them. When you click Setup for Codex Desktop in Prism, Prism writes a managed provider block into this file and generates a model catalog that includes all the models you have configured in Prism.

  Prism admin UI
           │  click "Setup" for Codex Desktop
           ▼
      writes managed provider block
      to ~/.codex/config.toml
           │
           ▼  generates model catalog
      Codex Desktop model picker
      now shows your custom models

On the next launch of Codex Desktop, the picker reads the updated config and displays your custom models alongside the OpenAI defaults. Selecting one routes requests through Prism to your configured upstream provider.

Step by step

1

Configure a provider in Prism

Open the Prism admin UI at http://127.0.0.1:8765/admin and set up a custom provider in the Provider tab. For example, add DeepSeek with base URL https://api.deepseek.com/v1 and your API key.
2

Add models

In the Modelstab, add the models you want to appear in Codex's picker. You can auto-fill from models.dev or add them manually.
3

Go to the Agents tab

Navigate to the Agents tab in the admin UI. You will see Codex Desktop listed among the supported agents.
4

Click Setup for Codex Desktop

Click Setup next to Codex Desktop. Prism writes the managed provider block to ~/.codex/config.toml and generates the model catalog. A confirmation message appears when the process is complete.
5

Relaunch Codex Desktop

Restart Codex Desktop (or launch it if it was not running). Open the model picker and your models will be listed, each showing its Prism display name.

What the config looks like

Prism writes a clearly marked managed block so it can update it without clobbering your manual edits:

# ~/.codex/config.toml

    # >>> prism-managed >>>
    model_provider = "prism"
    model_catalog_json = "C:\\Users\\you\\AppData\\Roaming\\prism\\codex_catalog.json"
    # <<< prism-managed <<<

    # >>> prism-managed >>>
    [model_providers.prism]
    name = "Prism"
    base_url = "http://127.0.0.1:11434/v1"
    wire_api = "responses"
    experimental_bearer_token = "prism"
    request_max_retries = 3
    stream_max_retries = 3
    stream_idle_timeout_ms = 600000
    # <<< prism-managed <<<

The model list itself lives in the generated catalog — a JSON file in Prism's own config directory that Codex reads through model_catalog_json. Re-syncing regenerates it from your Prism catalog.

Important
Do not edit the prism-managed blocks by hand. Prism rewrites them whenever you update models or click Setup again, and everything outside those markers is preserved. Note that Prism deliberately does not set the top-level model key — which model Codex starts with stays your choice.

Auto-sync

When you add or remove models in Prism's Models tab, Prism automatically updates the Codex Desktop config and model catalog. You do not need to click Setup again unless you are setting up Codex Desktop for the first time or on a new machine. The next time Codex Desktop launches, it picks up the updated model list.

If you prefer manual control, you can disable auto-sync in the admin UI and re-run Setup whenever you want to push model changes to Codex Desktop.

Supported models

Any model configured in Prism can be injected into Codex Desktop. Common choices include:

DeepSeek

deepseek-chat and deepseek-reasoner for powerful, affordable coding.

Llama

llama-3.3-70b-versatile via Groq for ultra-fast inference.

GLM

GLM models via OpenRouter or a custom provider.

Get started

Download Prism, configure a provider and models, then click Setup for Codex Desktop. Relaunch Codex and your custom models appear in the picker — no patches, no forks, no manual TOML editing.

Download Prism

Reference

Every claim on this page is checked against the Prism source, and the reference documentation is where those details live in full.

Try it yourself

Prism is a free, MIT-licensed local proxy for AI coding agents. Install it, point one agent at http://127.0.0.1:11434, and the rest of this post applies as written.