Skip to main content

Responses API to Chat Completions proxy for Codex-compatible model providers.

Project description

ds4codex

ds4codex is a small local proxy that lets Codex use DeepSeek models through a Responses-to-Chat translation layer.

The current shape is intentionally simple:

  • only one human-edited config file: ~/.codex/config.toml
  • one generated file for /model: ~/.codex/ds4codex-model-catalog.json
  • only two CLI commands: init and run

Install

cd /Volumes/data/github/seqyuan/ds4codex
pip install .

or:

pipx install .

Commands

Initialize Codex config and model catalog:

ds4codex init --apikey sk-your-deepseek-api-key

Start the proxy:

ds4codex run

What init Writes

ds4codex init updates ~/.codex/config.toml and generates:

~/.codex/ds4codex-model-catalog.json

It writes three managed blocks into ~/.codex/config.toml:

# BEGIN DS4CODEX ROOT
model = "deepseek-v4-flash"
model_provider = "ds4codex"
model_context_window = 1048576
model_catalog_json = "/home/you/.codex/ds4codex-model-catalog.json"
# END DS4CODEX ROOT

# BEGIN DS4CODEX SETTINGS
[ds4codex]
port = 8099
target_url = "https://api.deepseek.com/v1/chat/completions"
thinking = "disabled"
# END DS4CODEX SETTINGS

# BEGIN DS4CODEX PROVIDER
[model_providers.ds4codex]
name = "DeepSeek via ds4codex"
base_url = "http://127.0.0.1:8099/v1"
wire_api = "responses"
experimental_bearer_token = "sk-your-deepseek-api-key"
# END DS4CODEX PROVIDER

Where Settings Live

The proxy now reads its local runtime settings from:

[ds4codex]
port = 8099
target_url = "https://api.deepseek.com/v1/chat/completions"
thinking = "disabled"

That means ~/.config/ds4codex/config.toml is no longer needed.

thinking is only the default when Codex does not send an explicit reasoning level.

Accepted practical values are:

  • disabled
  • enabled
  • high
  • max

Compatibility mapping is applied for Codex-style reasoning levels:

  • low, medium, minimal -> high
  • xhigh -> max

Why the Proxy Is Still Required

Moving settings into ~/.codex/config.toml makes configuration cleaner, but it does not remove the need for the server itself.

Codex custom providers send:

  • wire_api = "responses"

DeepSeek currently documents:

  • chat.completions

So the proxy is still the protocol adapter between Codex Responses requests and DeepSeek Chat Completions requests.

/model Support

ds4codex init generates a model catalog JSON and points Codex at it through model_catalog_json.

That makes /model show:

  • DeepSeek V4 Flash
  • DeepSeek V4 Pro

and the catalog advertises these reasoning levels:

  • low
  • medium
  • high
  • xhigh

The proxy maps those levels to DeepSeek-compatible request fields before forwarding upstream.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ds4codex-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ds4codex-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file ds4codex-0.1.1.tar.gz.

File metadata

  • Download URL: ds4codex-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ds4codex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c397650edb5f6736315b4afe88b8f928eaca802f1405c130fd5eed50c0fd06c
MD5 49aee1295c49ee63eb3bfffba1e37a03
BLAKE2b-256 8ebbdd8abf2a7a6ca56ea055abd5aefbf4f67c240c674e5d94fb0d45e9c34e97

See more details on using hashes here.

File details

Details for the file ds4codex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ds4codex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ds4codex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e31567ad7c0257a2ab9d56a42c4928caf2b8c3e83f188971f14d32806c2fc02
MD5 b4e7dcdaa154c69a52758237e8d75711
BLAKE2b-256 42ab6b698743b9e3415254b78f463f4fb7124aadcb86e82f7cf06d68cfe3646f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page