Configuring a Local Model Router for Chinese LLMs in an AI Coding Desktop Client
This guide explains how to verify an AI coding desktop client installer, enable developer mode safely, install LiteLLM Proxy in an isolated Python environment, and configure it to route requests to a Chinese LLM provider such as Baidu AI Cloud Qianfan. It covers hash and signature checks, configuration fields, authentication considerations, environment variables, and binding the local router to the loopback address.
1. Preparation and Installer Verification
Before you begin, prepare three things: a computer running Windows 10 or Windows 11, a Chinese LLM provider account with model services enabled (this article uses Baidu AI Cloud Qianfan as an example), and a text file for recording configuration items. The setup process involves multiple keys and ports, so recording them in advance reduces repeated searching.
Obtain the installer only from official channels. Open the download page on the official website of the AI coding tool and check the domain in the browser address bar. Do not download through search ads or third-party cloud drives. Many official download pages publish the SHA256 digest of the installer. After downloading, run the following command in PowerShell:
Get-FileHash -Algorithm SHA256 .\installer.exe
Compare the output hash with the value published on the official page character by character. If they do not match, delete the file and download it again. If the official page does not provide a digest, right-click the installer, open the Digital Signatures tab in Properties, and confirm that the signer is the official company name. You can also run the following command to check the signature status; the result should be Valid:
Get-AuthenticodeSignature .\installer.exe
The routing tool should also come from an official source. This article uses the open-source project LiteLLM Proxy as an example because its configuration file and command-line parameters are publicly documented and easy to reproduce. If you use a graphical routing tool, refer to that tool’s official documentation for menu locations and switch names.
2. Install the Client and Enable Developer Mode
Double-click the installer and follow the wizard to complete the installation. Choose a path on a non-system drive, such as D:\Tools\, to make future migration and backup easier. If a Windows User Account Control prompt appears during installation, confirm that the program is the official installer you verified earlier before clicking Yes.
The entry point for developer mode varies by client version. Usually, you can open the client’s settings page and search for “developer,” or look under the Help or About menu. If you cannot find it, the current version may not offer this option. Consult the official documentation for that version instead of following menu paths from someone else’s article.
Back up the configuration before enabling it. If the client provides a settings export feature, export the settings to a local file. If it does not, enter %APPDATA% in the File Explorer address bar, locate the directory named after the client, and copy the entire directory to another location. The purpose of the backup is to restore the original state if something goes wrong.
Developer mode opens debugging interfaces and allows local extensions to be loaded. Therefore, enable it only on a computer you fully control. Do not enable it on a shared machine or a company public device. To disable it, return to the same location, clear the checkbox, and restart the client.
3. Configure the Model Router and the Chinese LLM
Choose the routing tool version based on the update notes on the official Release page. Prefer a release that explicitly states support for the client version you are using. Do not directly copy version numbers from other articles, as version information may be outdated.
Install LiteLLM in a separate Python virtual environment to avoid conflicts with other Python packages on the system. Replace the version number in the following commands with the version specified in the official documentation:
py -3 -m venv .venv-router.\.venv-router\Scripts\Activate.ps1pip install "litellm[proxy]==<version-from-official-docs>"
Create config.yaml in the same directory with the following content:
model_list:- model_name: qianfan-chatlitellm_params:model: openai/<model-name shown in the console>api_base: https://qianfan.baidubce.com/v2api_key: os.environ/QIANFAN_API_KEYgeneral_settings:master_key: os.environ/ROUTER_MASTER_KEY
The fields have the following meanings. model_name is the name entered in the client and can be customized. model is the model name on the provider side and must exactly match the name shown in the console, including capitalization and hyphens. api_base is the root address of the OpenAI-compatible endpoint provided by the vendor. Refer to the console documentation; it usually ends with /v1 or /v2. Do not include the /chat/completions path. api_key references an environment variable, so the key itself is not written into the configuration file. master_key is the access key for the local router, and the client must provide it when calling the router.
Confirm the authentication method first. Most new Qianfan platform setups use API Key authentication. If the console only provides AK/SK, read the vendor documentation first and confirm the corresponding authentication flow. Do not enter AK/SK directly as an API Key in the configuration, or the request will return a 401 error.
Pass the keys through environment variables. Set variables for the current session in PowerShell as follows:
$env:QIANFAN_API_KEY = "<your-provider-api-key>"$env:ROUTER_MASTER_KEY = [guid]::NewGuid().ToString("N")
The second line generates a random local access key. Record its value, because you will need it when configuring the client. If you want to keep it long term, add it in the System Properties environment variable settings rather than writing it into a script or configuration file.
When starting the routing service, bind the listening address to the local loopback address. This prevents other devices on the LAN from accessing the port:
litellm --config .\config.yaml --host 127.0.0.1 --port 4000
After the service starts, the terminal will continue to run.
