Use the company DeepSeek V4.1 in your coding agent
DeepSeek-V4.1-Flash runs on our own GPU server. You can use it from Claude Code, Codex, Hermes or any tool that speaks the OpenAI or Anthropic API. You need a personal API key; you get one by signing in with your Lark account. No tickets, no waiting.
1. Quick setup: one command (macOS, Linux, WSL)
Open a terminal and run:
curl -fsSL https://deepseek-dev.7.solutions/setup.sh | bash- The script shows a short code and opens your browser.
- Sign in with Lark, check that the code matches, and click Approve.
- The script receives a new personal key and sets up the agents it finds on your computer (Claude Code, Codex, Hermes). Your existing settings are not changed.
Then start your agent:
| Claude Code | claude-deepseek (your normal claude stays as it is) |
|---|---|
| Codex | codex-deepseek, or codex --profile deepseek7 |
| Hermes | hermes chat --provider deepseek7, or pick “DeepSeek V4.1 (7 Solutions)” in hermes model |
Script options
# only some agents
curl -fsSL https://deepseek-dev.7.solutions/setup.sh | bash -s -- --claude --codex
# also make DeepSeek the default model in Hermes
curl -fsSL https://deepseek-dev.7.solutions/setup.sh | bash -s -- --hermes --hermes-default
# remove everything the script added (then revoke the key on the My keys page)
curl -fsSL https://deepseek-dev.7.solutions/setup.sh | bash -s -- --uninstallThe script is plain bash: read it first with curl -fsSL https://deepseek-dev.7.solutions/setup.sh | less. It stores the key in ~/.config/deepseek7/credentials (readable only by you) and creates the wrappers in ~/.local/bin.
2. Manual setup (Windows, or if you prefer)
Get a key Sign in with Lark on the My keys page and create a key. It is shown once; copy it. In the snippets below, replace YOUR_KEY with it. After you create a key, the page shows the same snippets with the key already filled in.
Claude Code
Claude Code talks to the gateway's Anthropic-compatible endpoint. Put this in your shell profile (~/.zshrc or ~/.bashrc), or in a small wrapper script so your normal Claude login stays untouched:
export ANTHROPIC_BASE_URL=https://deepseek-api.7.solutions/anthropic
export ANTHROPIC_AUTH_TOKEN=YOUR_KEY
export ANTHROPIC_MODEL=gce-dsv41/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_OPUS_MODEL=gce-dsv41/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_SONNET_MODEL=gce-dsv41/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_HAIKU_MODEL=gce-dsv41/deepseek-v4.1-flash
export CLAUDE_CODE_SUBAGENT_MODEL=gce-dsv41/deepseek-v4.1-flash
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=262144
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export API_TIMEOUT_MS=600000
claudeEvery model slot (Opus, Sonnet, Haiku, sub-agents) points at DeepSeek, so nothing is sent to Anthropic. CLAUDE_CODE_MAX_CONTEXT_TOKENS sets when Claude Code compacts; raise it up to 1000000 for very large codebases.
Codex CLI
Create the profile file ~/.codex/deepseek7.config.toml (Codex 0.134 or newer; your main config.toml is not touched):
model_provider = "deepseek7"
model = "gce-dsv41/deepseek-v4.1-flash"
model_context_window = 262144
[model_providers.deepseek7]
name = "DeepSeek V4.1 (7 Solutions)"
base_url = "https://deepseek-api.7.solutions/v1"
env_key = "DEEPSEEK7_API_KEY"
wire_api = "responses"Then run Codex with that profile:
export DEEPSEEK7_API_KEY=YOUR_KEY
codex --profile deepseek7Codex prints “Model metadata … not found, defaulting to fallback metadata”. That warning is expected for a self-hosted model and harmless.
Hermes Agent
Adds a provider named deepseek7. The key goes to Hermes' .env, never to config.yaml:
hermes config set providers.deepseek7.name "DeepSeek V4.1 (7 Solutions)"
hermes config set providers.deepseek7.api https://deepseek-api.7.solutions/v1
hermes config set providers.deepseek7.key_env DEEPSEEK7_API_KEY
hermes config set providers.deepseek7.transport chat_completions
hermes config set providers.deepseek7.default_model gce-dsv41/deepseek-v4.1-flash
hermes config set providers.deepseek7.context_length 262144
hermes config set 'agent.reasoning_overrides.gce-dsv41/deepseek-v4\.1-flash' high
hermes config set DEEPSEEK7_API_KEY YOUR_KEYUse it once with hermes chat --provider deepseek7 -m gce-dsv41/deepseek-v4.1-flash, or make it your default with hermes model and pick “DeepSeek V4.1 (7 Solutions)”. The reasoning override is required: DeepSeek V4.1 accepts low / high / xhigh / max, not Hermes' default “medium”.
Any other tool (OpenAI or Anthropic compatible)
| OpenAI base URL | https://deepseek-api.7.solutions/v1 (Chat Completions and Responses) |
|---|---|
| Anthropic base URL | https://deepseek-api.7.solutions/anthropic (Messages) |
| Model | gce-dsv41/deepseek-v4.1-flash |
| API key | your personal key, as Authorization: Bearer or x-api-key |
curl https://deepseek-api.7.solutions/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" \
-d '{"model":"gce-dsv41/deepseek-v4.1-flash","messages":[{"role":"user","content":"Hello"}]}'Windows PowerShell: set the same variables with $env:NAME = "value" (for example $env:ANTHROPIC_AUTH_TOKEN = "YOUR_KEY"), or permanently with setx NAME value. The Codex profile file goes to %USERPROFILE%\.codex\deepseek7.config.toml.
3. Good to know
- Shared GPU. One server serves everyone: about 4 answers at full speed at once (~35 tokens/s each), and long prompts are read at ~5,000 tokens/s. Please don't run unattended loops with many parallel agents.
- Context. Up to 1M tokens. The snippets set 262,144 because huge contexts are slow and use memory everyone shares; raise it when you really need more.
- Your keys. Up to 5 keys per person (one per computer is a good habit). Each key allows 120 requests per minute and expires after 90 days; run the setup again to get a fresh one. Revoke a lost key right away on My keys.
- Availability. The GPU is a low-cost Spot machine. If Google reclaims it, it restarts on its own; expect errors for about 20–30 minutes, then it works again.
- Privacy. Everything runs in the company Google Cloud project. The gateway does not store prompts or answers.
- Browser chat. For plain chat, use https://deepseek.7.solutions (Lark login, no key needed).
4. Troubleshooting
| HTTP 401 “virtual key …” | The key is wrong, revoked or expired. Run the setup command again, or create a new key. |
|---|---|
| HTTP 429 | More than 120 requests in a minute with one key. Slow down or wait a minute. |
| HTTP 502 / 503 / timeouts | The GPU server is restarting (Spot reclaim). Try again in ~20–30 minutes. |
| Hermes: “reasoning_effort must be low, high …” | Run hermes config set 'agent.reasoning_overrides.gce-dsv41/deepseek-v4\.1-flash' high. |
| Hermes: 401 right after setup | Restart the Hermes gateway so it re-reads .env: hermes gateway restart. |
claude-deepseek: command not found | Add ~/.local/bin to your PATH: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc, then open a new terminal. |