Claude Code Chinese Localization and DeepSeek Integration Guide
This guide explains how to connect the Claude Code desktop app to DeepSeek without modifying the client, by placing a local LLM proxy between the two that handles authentication injection, protocol conversion, and model-name mapping. It covers preparing a DeepSeek API key and base URL, building or configuring a minimal local proxy, pointing the client at that proxy, and verifying the full chain step by step from the command line to the client. It also covers protocol and tool-call conversion, streaming responses, context and token budgeting, and a safety checklist for localizing the UI to Chinese. Finally, it addresses credential protection, log redaction, data-egress checks, and licensing considerations, and shows how a personal setup can evolve into a team-level model gateway.
1. Starting with a Local Coding Tool: Why Localization and Model Integration Matter
Many developers who try the Claude Code desktop app run into three practical problems. The interface and prompts are primarily in English, which makes reading and operating the tool less smooth. The official model service relies on specific account, network, and payment arrangements that are not available to everyone. And source code and business context can involve sensitive data, so sending it directly to an external model service raises data governance concerns. This is why requests like “Claude Code Chinese localization,” “DeepSeek integration,” and “local coding tool” come up so often.
This article is not about simply switching the interface to Chinese. It presents a more complete engineering approach: without modifying the client’s core logic, connect Claude Code or a similar desktop coding tool to a model service such as DeepSeek through a local LLM proxy. In other words, the client handles interaction, the local proxy handles protocol conversion, and the model service handles inference. This improves both the language experience and the freedom to choose models.
One point is worth stressing up front: localization and model integration can be done separately. Even if the interface stays in English, the model already works once the proxy link is established; conversely, localizing the interface does not depend on DeepSeek integration. They are two separate things, but doing both well gives a more complete overall experience.
2. The Overall Approach: Turning a Fixed Vendor Dependency into a Replaceable Architecture
Many desktop coding tools support a custom service address, or can read an endpoint URL and key from environment variables. This shows that there is usually a replaceable contract between the client and the model service: an HTTP interface plus an authentication credential. As long as you adapt at this contract layer, you can swap the backend model without changing the client itself.
The sensible approach, therefore, is not to patch the client but to introduce a local adapter proxy. The architecture can be split into three layers:
| Layer | Main Responsibilities | Key Elements |
|---|---|---|
| Client layer | UI interaction, context management, file read/write, tool-call orchestration | Coded only against a standard interface protocol |
| Adapter layer | Local proxy: auth injection, protocol conversion, model mapping, streaming passthrough, logging | Runs on a loopback address, replaceable at any time |
| Model layer | Actual inference service | Cloud API, self-hosted deployment, or self-built inference service |
The request flow can be abstracted as:
[ Desktop Coding Client ]│ Standard HTTP/JSON requests, possibly with streaming responses▼[ Local Adapter Proxy 127.0.0.1:8787 ]│ ① Inject auth credentials│ ② Convert request-body protocol│ ③ Map model name│ ④ Convert response body back│ ⑤ Pass through streaming data│ ⑥ Log and gather error statistics▼[ Model Inference Service ] ← DeepSeek API / other compatible endpoints / self-hosted model service
The value of this layering is decoupling. The client does not need to know whether the backend is DeepSeek or another model, and the model service can be swapped at any time. Cross-cutting concerns such as authentication, logging, rate limiting, and auditing can be handled centrally in the proxy layer instead of being reconfigured in every client.
3. Preparing to Integrate DeepSeek: Console, API Key, Base URL, and Model Identifier
If the goal is to integrate DeepSeek, confirm a few basics first. Endpoint details may change between providers or across releases, so the actual setup should always defer to the official DeepSeek console and the latest documentation, though the overall flow is usually consistent.
3.1 Enable the Service and Create an API Key
The general flow is:
- Log in to the model provider’s console;
- Enable the corresponding model inference service;
- Create a call key, i.e., the API Key;
- Record the key’s purpose, creation time, and validity period;
- Follow the principle of least privilege, granting only model-call permissions.
Do not paste the key directly into the client UI, and do not commit it to a code repository. A safer approach is to keep the key in the local proxy’s environment variables or a secrets manager.
3.2 Common DeepSeek Integration Fields
Using the DeepSeek-compatible interface as an example, the following details usually matter:
| Item | Example or Notes |
|---|---|
| Base URL | Commonly https://api.deepseek.com or https://api.deepseek.com/v1; defer to the official documentation |
| Authentication | Request header carries Authorization: Bearer <API_KEY> |
| Model identifier | Commonly deepseek-chat; the actual value follows the console documentation |
| Endpoint path | Commonly /v1/chat/completions |
| Streaming parameter | "stream": true |
| Tool calls | For function calling, confirm whether the target model supports the tool-call protocol |
You can first verify that the DeepSeek endpoint is reachable with the following command:
export DEEPSEEK_API_KEY="sk-xxxxxxxx"curl https://api.deepseek.com/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer $DEEPSEEK_API_KEY" \-d '{"model": "deepseek-chat","messages": [{"role": "user", "content": "Explain what dependency injection is in one sentence"}],"stream": true}'
If the command returns content block by block, the key, address, model, and streaming parameter are basically correct. If it returns 401 or 403, first check whether the key is valid and has sufficient permissions; if it returns 404, first check whether the model identifier or endpoint path is wrong.
4. The Local Proxy: A Minimal, Practical Solution
The local proxy is the core of the whole setup. It runs on the developer’s own machine, receives client requests, injects the real key, converts the request into a format DeepSeek accepts, and streams the response back to the client.
4.1 Choosing How to Implement the Proxy
There are two common routes.
The first is to use an existing compatible proxy or gateway tool. For example, some proxy or gateway tools support OpenAI-compatible interfaces and can be configured with an upstream address, key, and model mapping. The advantage of these tools is a fast start, which makes them good for quick validation.
The second is to build a minimal proxy of your own. If the team wants full control over protocol conversion, log fields, authentication, and error handling, you can implement a lightweight proxy in Python, Go, or Node.js. As long as the proxy can listen on a local port and forward requests to DeepSeek, that is enough for a basic integration.
Whichever route you take, it is recommended that the proxy at least provide the following capabilities:
- Listen on
127.0.0.1to avoid direct exposure to the public internet; - Read the key from environment variables;
- Support model-name mapping;
- Support streaming response passthrough;
- Record request ID, latency, error codes, and token usage;
- Redact keys and source-code content in logs.
4.2 Sample Proxy Configuration
A minimal configuration can include the following fields:
[server]listen = 127.0.0.1:8787[upstream]base_url = https://api.deepseek.comapi_key = ${DEEPSEEK_API_KEY}model = deepseek-chat[options]timeout_seconds = 600stream = truemax_context_tokens = 64000
Here, api_key should not be written into the config file in plaintext; it is best injected via an environment variable. For example:
export DEEPSEEK_API_KEY="sk-xxxxxxxx"python local_proxy.py
On Windows PowerShell, you can set it like this:
$env:DEEPSEEK_API_KEY="sk-xxxxxxxx"python local_proxy.py
4.3 Startup and Port Check
After the proxy starts, first check whether the port is listening.
Linux or macOS:
ss -lntp | grep 8787
Windows:
netstat -ano | findstr :8787
You can also directly hit the proxy’s health-check endpoint:
curl http://127.0.0.1:8787/v1/models \-H "Authorization: Bearer local-proxy"
If it returns a model list or a normal response, the proxy has at least started. You can then request DeepSeek through the proxy:
curl http://127.0.0.1:8787/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer local-proxy" \-d '{"model": "deepseek-chat","messages": [{"role": "user", "content": "Test the proxy chain"}],"stream": true}'
If the proxy chain is not working, troubleshoot in the order “direct upstream first, then the proxy, then the client.” First use curl to hit DeepSeek directly to confirm the model service itself is available; then check the proxy port, environment variables, and logs; finally check the client configuration.
4.4 Model Name Mapping
Desktop clients sometimes support only fixed model names, while DeepSeek’s model identifiers may differ. The proxy needs to maintain a mapping table that converts the client-supplied model name into the target model name.
def resolve_model(client_model: str) -> str:return MODEL_ALIAS.get(client_model, DEFAULT_MODEL)
For example:
MODEL_ALIAS = {"claude-3.5-sonnet": "deepseek-chat","gpt-4o": "deepseek-chat","default": "deepseek-chat"}DEFAULT_MODEL = "deepseek-chat"
This way, even if the client requests a default model name, the proxy maps it to the corresponding DeepSeek model.
5. Pointing the Claude Code Desktop App at the Local Proxy
The configuration entry point may differ across desktop client versions, but it generally revolves around two fields: the service address and the call key.
5.1 Installation Source
Whether you use the Claude Code desktop app or a similar client, only download and install the package from official channels. Do not use “cracked localization” builds, “portable” builds, or third-party modified packages of unknown origin, as these can bring account leaks, injected malicious code, certificate replacement, or legal risk.
5.2 Settings Entry Points
Common entry points include:
- Settings in the top-right or bottom-left of the client;
- A Settings or Preferences menu;
- Options such as Model Provider, API, or Custom Endpoint;
- Choosing a custom OpenAI-compatible or custom Anthropic-compatible service.
If the client supports a custom service address, you can typically fill in:
| Setting | Recommended Value |
|---|---|
| Base URL | http://127.0.0.1:8787 or http://127.0.0.1:8787/v1 |
| API Key | A local placeholder such as local-proxy |
The key point here: when the client talks to the local proxy, it does not need the real DeepSeek key. The real key stays only on the proxy side.
5.3 Using Environment Variables
If the client has no graphical entry point, try configuring it through environment variables. Different clients may use different variable names; common ones include:
export ANTHROPIC_BASE_URL="http://127.0.0.1:8787"export ANTHROPIC_API_KEY="local-proxy"export OPENAI_BASE_URL="http://127.0.0.1:8787/v1"export OPENAI_API_KEY="local-proxy"
If the client uses an Anthropic-style interface, the local proxy needs to handle requests like /v1/messages and convert them to DeepSeek’s /v1/chat/completions. If the client supports an OpenAI-compatible interface, the proxy can prefer to expose an OpenAI-compatible endpoint.
The actual fields depend on the client version you use. If the UI or environment variable names differ from this article, check that client’s official documentation rather than blindly editing system files.
6. Step-by-Step Verification: From the Command Line to the Full Client Chain
Verify in order from the outside in, and from simple to complex.
Step 1: Connect Directly to DeepSeek
Use curl to request DeepSeek directly, confirming that the key, model, network, and streaming output are all working.
Step 2: Connect Directly to the Local Proxy
Use curl to request the local proxy, confirming that the proxy completes auth injection, protocol conversion, and streaming passthrough.
Step 3: Start a Conversation in the Client
Open Claude Code or the corresponding desktop client and enter a simple question, for example:
Please explain what dependency injection is in Chinese.
If the client displays the reply correctly and the Chinese text is not garbled, the basic chain is working.
Step 4: Test File Reading
Have the model read a file and explain its purpose, verifying that the client correctly passes the file content, context, and tool calls. For example:
Please read README.md and summarize the project's main purpose in Chinese.
Step 5: Test a Modify Operation
Have the model modify a function and save it, and observe whether the tool-call parameters are complete. If a tool call fails, focus on the tool name, missing parameters, and error code in the proxy logs.
Step 6: Stress-Test a Long Task
Send multiple rounds of interaction in a row and watch for timeouts, truncation, streaming interruptions, or parameter anomalies. For long answers, it is recommended to set a higher proxy timeout, such as 600 seconds.
7. Protocol Conversion and Tool Calls: Where Problems Most Often Appear
Many clients claim compatibility with a given interface, but field differences can still exist between providers. Common differences include the position of the system prompt, sampling parameter names, message content structure, nesting levels of tool declarations, and finish-reason enum values.
The proxy should manage field mapping centrally rather than scattering it across the code. At minimum, it should cover:
| Concern | Possible Difference | Recommended Handling |
|---|---|---|
| System prompt | Some put it in the messages array, some use a separate field | Normalize into a system message in the messages array |
| Sampling parameters | Different names or value ranges | Whitelist-filter and trim illegal values |
| Message structure | Mix of plain text and content-block arrays | Preserve the structure, convert when necessary |
| Tool declarations | Different field nesting | Rebuild tool definitions per the target protocol |
| Tool results | Different reply-back formats | Convert into the target protocol’s message type |
| Finish reason | Different enum values | Build a bidirectional mapping table |
When a tool call fails, it is recommended to log the following fields in the proxy:
request_idclient_modelupstream_modeltool_namemissing_paramserror_codefinish_reasonlatency_ms
This makes it quick to determine whether the problem is an incompatible tool definition, a missing parameter, or the model not returning the call structure as expected.
If you need to debug tool calls manually, first use curl to construct a request that includes a tool, and observe whether the proxy forwards it completely:
curl http://127.0.0.1:8787/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer local-proxy" \-d '{"model": "deepseek-chat","messages": [{"role": "user", "content": "Please call the read_file tool to read config.yaml"}],"tools": [{"type": "function","function": {"name": "read_file","description": "Read the contents of a specified file","parameters": {"type": "object","properties": {"path": {"type": "string"}},"required": ["path"]}}}],"stream": true}'
If the model returns a tool-call intent but the client cannot recognize it, check whether the response conversion preserved the tool name and parameter structure.
8. Streaming Responses: Keeping Token-by-Token Output Smooth
The experience of an AI coding tool depends heavily on time-to-first-token. If the proxy buffers the response, the user will feel lag even when the final content is correct.
The proxy needs to focus on:
- Disabling unnecessary response buffering;
- Preserving the incremental fields of streaming responses;
- Correctly passing through the end-of-stream marker;
- Sending the client an expected end signal when the upstream is interrupted;
- Setting a sufficiently long timeout for long answers;
- Adding a heartbeat when necessary to avoid intermediate network devices closing the connection early.
If the client produces no output at all, first check whether the proxy is returning streaming data. You can use curl to observe whether output arrives block by block:
curl -N http://127.0.0.1:8787/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer local-proxy" \-d '{"model":"deepseek-chat","messages":[{"role":"user","content":"Please stream a Chinese explanation"}],"stream":true}'
Here, -N disables curl’s buffering so you can observe the streaming output.
9. Context Management and Cost Control
Once a model is connected to a local coding client, the context is usually larger than a single request. The proxy layer needs to help control the token budget.
An example budget table:
| Content Type | Sample Budget | Notes |
|---|---|---|
| System prompt | 1500 tokens | Kept stable long-term to benefit from prefix caching |
| Tool declarations | 3500 tokens | Adjusted dynamically to the client’s number of tools |
| History messages | 40000 tokens | Trim the earliest turns when exceeded |
| New user input | 15000 tokens | The current interaction’s content |
| Output reserve | 3000 tokens | Space reserved for the model’s answer |
If the total context window is 64000 tokens, history messages cannot grow indefinitely. The proxy can trim the earliest conversation turns by policy, or summarize overly long file content. Note that when compressing content, it is best to let the model know that “the content has been compressed,” to avoid it misjudging the completeness of the context.
In addition, it is recommended to record each request’s input token count, output token count, and total latency in the proxy layer. This supports cost accounting and makes later quota management easier.
10. Localizing the Claude Code Desktop App: Two Paths and a Checklist
Localization falls into two categories: official capabilities and community resources. Preferring official capabilities is the lowest-risk approach.
Path 1: Official Language Settings
First check whether the client already includes Chinese or multilingual support. Common locations include:
- Settings;
- Preferences;
- Appearance;
- Language;
- General.
If a Simplified Chinese option exists, just switch to it. If the current version has no Chinese, first check whether a newer version is available. Many clients gradually add language support in new releases.
Path 2: Community Localization Resources
If no official Chinese option exists, you can consider community-maintained localization resources. Common forms include:
zh-CN.jsonlanguage packs;- UI string configuration files;
- Resource files or UI replacement packages;
- Localization patches generated for a specific client version.
Use these with caution. The following checklist is recommended:
- Verify the resource source: only use resources with a clear maintainer, version history, and documentation.
- Verify version compatibility: localization resources are usually tied to a specific client version, and a mismatch can cause misaligned controls or prevent startup.
- Verify the file hash: for example, use
sha256sumorcertutilto confirm file integrity. - Back up the original resources: do not overwrite directly; first copy the entire client resource directory or key files.
- Quit the client: close the client process before replacing resources.
- Replace the files: place the localization resources in the designated directory.
- Verify startup: check that the main menus, settings page, and prompts display correctly.
- Roll back: if it fails to start, restore the original resources from backup.
A generic backup example:
mkdir -p ~/backup/claude-codecp -R "/Applications/Claude Code.app" ~/backup/claude-code/
If the app crashes, shows garbled text, or has misaligned buttons after replacement, roll back first. Rolling back usually means deleting the added localization files and restoring the original resources from backup.
A special note: the interface language is only an experience-layer issue and does not affect model integration. If community localization carries higher risk, you can temporarily keep the English interface and ensure the model chain is stable first.
11. Security and Compliance: The Part You Can’t Skip
Local integration is not finished just because you hide the key. When source code, business context, and third-party client modifications are involved, you need to consider the security boundary more completely.
11.1 Credential Protection
The DeepSeek API Key should live only in the proxy configuration, environment variables, or a secrets manager. Do not write it into the client configuration, do not commit it to a Git repository, and do not expose the full key in screenshots.
11.2 Listening Scope
The proxy is recommended to listen only on:
127.0.0.1
Do not listen on 0.0.0.0 unless you clearly know what you are doing and have configured transport encryption, access control, and strong authentication.
11.3 Log Redaction
By default, proxy logs should not record full prompts and source-code content. You can record request IDs, model names, latency, error codes, token counts, and summary hashes. Error logs likewise need to filter out keys.
11.4 Confirming Data Egress
Source code, dependencies, error stacks, and configuration files may contain sensitive information. Before connecting to a cloud model, confirm whether this content can be sent out. For core business code, prefer self-hosted deployment, private networks, or enterprise compliance interfaces.
11.5 Compliance for Third-Party Client Localization
When localizing a third-party client, also pay extra attention to:
- Reading the client’s user agreement and terms of service;
- Confirming whether modifying UI resources is allowed;
- Checking relevant open-source licenses and trademark-use rules;
- Not distributing cracked patches, license-bypass patches, or license-circumvention mechanisms;
- Not spreading modification methods that could trigger account risk controls;
- Even for personal use, evaluating whether it violates the software license agreement.
In other words, localization can pursue a better experience, but it must not cross legal, licensing, or account-security boundaries.
12. Troubleshooting Matrix for Common Failures
In real use, problems often cluster around the network, timeouts, streaming, tool calls, and localization-resource versions. Use the matrix below to locate issues quickly.
| Scenario | Possible Cause | Recommended Handling |
|---|---|---|
| 401/403 | Wrong key or insufficient permissions | Verify the key with curl against the upstream directly |
| 404 | Wrong Base URL or model identifier | Check the address and model name in the official documentation |
| Request timeout | Long answer exceeds the default timeout | Raise the timeout to 300–600 seconds |
| Occasional timeout | Network jitter or upstream queuing | Add retries, using exponential backoff only for 429 and 5xx |
| 429 rate limit | Too much concurrency or insufficient quota | Lower concurrency and increase backoff, e.g., 1s, 2s, 4s |
| No streaming output | Proxy buffers the response | Check chunked transfer, encoding, and proxy buffering settings |
| Reply truncated | Output length limit too low | Increase the max output tokens |
| Garbled Chinese | Missing encoding declaration | Use UTF-8 consistently |
| Tool call fails | Tool definition structure mismatch | Print the converted request body and compare field structures |
| App crashes after localization | Resource version mismatch | Roll back to the backup and wait for a matching version |
| Client can’t reach the proxy | Wrong port, path, or environment variable | Use curl to check the proxy port and endpoint path |
When troubleshooting, follow the layered approach: first confirm that direct DeepSeek access works, then confirm the local proxy works, and finally confirm the client configuration.
13. From Personal Local Integration to a Team-Level Solution
The local proxy solves the usage problem for an individual developer. To roll it out to a team, you can upgrade the proxy layer into a model gateway.
A team-level solution typically includes the following capabilities:
- Unified authentication: team members use a single identity system, with real keys managed centrally;
- Multi-model routing: route tasks such as code completion, code review, and documentation generation to different models;
- Quotas and metering: track token consumption by project and by member;
- Auditing and monitoring: record call volume, latency, error rates, and anomalous access;
- Failover: automatically switch to a backup model when one model is unavailable.
When deploying in the cloud, prefer vendor-neutral solutions rather than locking into a single brand. During selection, you can compare multiple cloud providers’ container platforms, secrets management, logging services, monitoring and alerting, private networking, and object storage capabilities. The core principle: keep infrastructure as standardized as possible, and keep the model service replaceable.
14. Conclusion: Build a Minimal Loop First, Then Refine
Getting the Claude Code desktop app to use DeepSeek is not complicated. The key is to establish the layered mental model of “client–local proxy–model service.” Localization solves the interface-language problem, and the proxy solves the model-integration problem; they can be done independently or combined.
The recommended rollout order is:
- First connect directly to DeepSeek, confirming that the key, model, and streaming output work;
- Then start the local proxy, completing protocol conversion and auth injection;
- Then point the client at the local proxy;
- Then test conversations, file reading, and modify-and-save tool calls;
- Finally add logging, redaction, rollback, and compliance checks.
Following this order, even if you later change model providers, you only need to adjust the proxy configuration, and the migration cost stays low. For individual developers, this is a path that can be validated quickly; for teams, it can naturally evolve into a more complete model gateway solution.
