npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@galaxy-yearn/codex-deepseek-gateway

v0.1.6

Published

Local OpenAI Codex Responses API gateway for DeepSeek Chat Completions.

Readme

Codex DeepSeek Gateway

A lightweight local gateway for using DeepSeek models in Codex.

Codex keeps using the OpenAI Responses API wire format. The gateway translates requests to DeepSeek-compatible Chat Completions, calls DeepSeek, then translates the result back to Responses JSON or response.* SSE events.

Package: @galaxy-yearn/codex-deepseek-gateway

Requirements

  • Node.js 22 or newer
  • A DeepSeek API key
  • Codex CLI 0.142.0 or newer is recommended

Install

npm install -g @galaxy-yearn/codex-deepseek-gateway
codex-deepseek-gateway --version
codex-deepseek-gateway install

The runtime is copied to ~/.codex/deepseek-gateway. Put your DeepSeek API key in:

~/.codex/deepseek-gateway/config/gateway.local.json
{
  "upstreamApiKey": "sk-..."
}

install preserves an existing gateway.local.json. If this is your first install, add the key and start the gateway:

codex-deepseek-gateway start
codex-deepseek-gateway status

status should show "reachable": true.

Codex Config

Add this provider to ~/.codex/config.toml:

model_provider = "deepseek-gateway"
model = "deepseek-v4-pro"
model_reasoning_effort = "xhigh"
model_supports_reasoning_summaries = true
model_reasoning_summary = "auto"

[model_providers.deepseek-gateway]
name = "DeepSeek"
base_url = "http://127.0.0.1:3000/v1"
wire_api = "responses"

Restart Codex after editing config.toml.

Usage

Start a new Codex conversation with gateway overrides:

codex-deepseek-gateway new

Resume a Codex session from the current project:

codex-deepseek-gateway sessions

When using the gateway, prefer these new / sessions commands over plain codex / codex resume. The launcher adds the gateway provider, model catalog, model, and reasoning overrides.

In the interactive session picker, use Up/Down to move through a scrolling window of sessions. Press n to start a new conversation instead of resuming an existing session.

Useful non-interactive forms:

codex-deepseek-gateway new --model deepseek-v4-flash --reasoning-effort low  # start with explicit model and effort
codex-deepseek-gateway sessions --print                                      # list resume commands
codex-deepseek-gateway sessions --all                                        # include sessions from all projects
codex-deepseek-gateway sessions --exec <id-or-row>                           # resume directly by row or session id

new chooses a model, then Codex reasoning effort. sessions chooses a session first, then model and reasoning effort. Both launch Codex with:

codex -c model_provider=deepseek-gateway -c model=<model> -c model_reasoning_effort=<effort> -c model_supports_reasoning_summaries=true -c model_reasoning_summary=auto

The installed launcher also passes model_catalog_json pointing at the packaged gateway Codex catalog, so Codex-native multi-agent validation accepts the DeepSeek model aliases and low|medium|high|xhigh reasoning efforts. This Codex setting replaces the default model catalog for that Codex process; it is not merged into it.

Inside a launcher-started Codex TUI, /model can switch between the packaged DeepSeek models and reasoning efforts.

Model aliases are read from:

~/.codex/deepseek-gateway/config/model-aliases.json

model-aliases.json is managed by this package and is refreshed on install. The packaged Codex catalog currently allows the default aliases deepseek-v4-flash and deepseek-v4-pro for Codex-native sub-agent validation.

Commands

codex-deepseek-gateway install    # copy runtime into ~/.codex/deepseek-gateway
codex-deepseek-gateway start      # start the local gateway
codex-deepseek-gateway stop       # stop the local gateway
codex-deepseek-gateway status     # show process and endpoint status
codex-deepseek-gateway doctor     # inspect config and request mapping
codex-deepseek-gateway new        # start a Codex conversation through the launcher
codex-deepseek-gateway sessions   # pick and resume a Codex session through the launcher
codex-deepseek-gateway uninstall  # remove the local runtime

doctor checks the active Codex config, DeepSeek request shape, reasoning mode, and optional web-search backend readiness.

To remove the local runtime and then uninstall the global package:

codex-deepseek-gateway uninstall
npm uninstall -g @galaxy-yearn/codex-deepseek-gateway

Reasoning

Codex effort maps to DeepSeek V4 thinking mode:

| Codex effort | DeepSeek request | | --- | --- | | low | thinking.type = disabled | | medium | thinking.type = enabled, reasoning_effort = high | | high | thinking.type = enabled, reasoning_effort = high | | xhigh | thinking.type = enabled, reasoning_effort = max |

When DeepSeek returns reasoning_content, the gateway preserves the raw text for DeepSeek history and sends a display-only Markdown-cleaned copy through Codex's reasoning summary UI. The raw reasoning is not duplicated into visible message content.

Web Search

Web search is optional and off by default. Configure Tavily for search:

{
  "tavilyApiKey": "tvly-...",
  "tavilyWebSearchEnabled": true
}

Configure Firecrawl if you also want opened-page reading:

{
  "firecrawlApiKey": "fc-...",
  "firecrawlWebFetchEnabled": true
}

Codex can keep requesting web_search / web_search_preview. The gateway exposes compact internal web tools to DeepSeek, executes Tavily/Firecrawl calls itself, feeds tool results back to the model, and returns Codex-compatible web_search_call items. TAVILY_MAX_SEARCH_ROUNDS defaults to 10 and is only a runaway/cost guardrail; when reached, the gateway disables web tools for one final-answer turn.

Final answers should include useful source titles and URLs directly.

Limits

Chat Completions is not a full Responses API replacement.

  • Hosted tools without a local Codex executor are represented as function shims. Web search is the only hosted tool the gateway emulates directly.
  • Tavily/Firecrawl web emulation is text-focused; it does not provide browser control, screenshots, raw HTML, cookies, crawl jobs, or private-network access.
  • OpenAI file_id values are passed through; the gateway cannot fetch private OpenAI-hosted files.
  • In-memory previous_response_id / conversation history is lost when the gateway process restarts.
  • Plain codex commands do not automatically load the packaged model catalog. Use the launcher when you want TUI /model and sub-agent validation to use the DeepSeek catalog.

License

MIT. See LICENSE.