mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
docs: fix alert block formatting and command path
This commit is contained in:
parent
f6a90dd26b
commit
8cead5a469
2 changed files with 16 additions and 6 deletions
|
|
@ -7,9 +7,11 @@ Qwen Code allows you to configure multiple model providers through the `modelPro
|
|||
Use `modelProviders` to declare curated model lists per auth type that the `/model` picker can switch between. Keys must be valid auth types (`openai`, `anthropic`, `gemini`, `vertex-ai`, etc.). Each entry requires an `id` and **must include `envKey`**, with optional `name`, `description`, `baseUrl`, and `generationConfig`. Credentials are never persisted in settings; the runtime reads them from `process.env[envKey]`. Qwen OAuth models remain hard-coded and cannot be overridden.
|
||||
|
||||
> [!note]
|
||||
>
|
||||
> Only the `/model` command exposes non-default auth types. Anthropic, Gemini, Vertex AI, etc., must be defined via `modelProviders`. The `/auth` command intentionally lists only the built-in Qwen OAuth and OpenAI flows.
|
||||
|
||||
> [!warning]
|
||||
>
|
||||
> **Duplicate model IDs within the same authType:** Defining multiple models with the same `id` under a single `authType` (e.g., two entries with `"id": "gpt-4o"` in `openai`) is currently not supported. If duplicates exist, **the first occurrence wins** and subsequent duplicates are skipped with a warning. Note that the `id` field is used both as the configuration identifier and as the actual model name sent to the API, so using unique IDs (e.g., `gpt-4o-creative`, `gpt-4o-balanced`) is not a viable workaround. This is a known limitation that we plan to address in a future release.
|
||||
|
||||
## Configuration Examples by Auth Type
|
||||
|
|
@ -273,6 +275,7 @@ export VLLM_API_KEY="not-needed"
|
|||
```
|
||||
|
||||
> [!note]
|
||||
>
|
||||
> The `extra_body` parameter is **only supported for OpenAI-compatible providers** (`openai`, `qwen-oauth`). It is ignored for Anthropic, Gemini, and Vertex AI providers.
|
||||
|
||||
## Bailian Coding Plan
|
||||
|
|
@ -317,6 +320,7 @@ The region is selected during authentication and stored in `settings.json` under
|
|||
When you configure Coding Plan through the `/auth` command, the API key is stored using the reserved environment variable name `BAILIAN_CODING_PLAN_API_KEY`. By default, it is stored in the `settings.env` field of your `settings.json` file.
|
||||
|
||||
> [!warning]
|
||||
>
|
||||
> **Security Recommendation**: For better security, it is recommended to move the API key from `settings.json` to a separate `.env` file and load it as an environment variable. For example:
|
||||
>
|
||||
> ```bash
|
||||
|
|
@ -357,13 +361,15 @@ If you prefer to manually configure Coding Plan models, you can add them to your
|
|||
```
|
||||
|
||||
> [!note]
|
||||
>
|
||||
> When using manual configuration:
|
||||
|
||||
>
|
||||
> - You can use any environment variable name for `envKey`
|
||||
> - You do not need to configure `codingPlan.*`
|
||||
> - **Automatic updates will not apply** to manually configured Coding Plan models
|
||||
|
||||
> [!warning]
|
||||
>
|
||||
> If you also use automatic Coding Plan configuration, automatic updates may overwrite your manual configurations if they use the same `envKey` and `baseUrl` as the automatic configuration. To avoid this, ensure your manual configuration uses a different `envKey` if possible.
|
||||
|
||||
## Resolution Layers and Atomicity
|
||||
|
|
@ -382,6 +388,7 @@ The effective auth/model/credential values are chosen per field using the follow
|
|||
\*When present, CLI auth flags override settings. Otherwise, `security.auth.selectedType` or the implicit default determine the auth type. Qwen OAuth and OpenAI are the only auth types surfaced without extra configuration.
|
||||
|
||||
> [!warning]
|
||||
>
|
||||
> **Deprecation of `security.auth.apiKey` and `security.auth.baseUrl`:** Directly configuring API credentials via `security.auth.apiKey` and `security.auth.baseUrl` in `settings.json` is deprecated. These settings were used in historical versions for credentials entered through the UI, but the credential input flow was removed in version 0.10.1. These fields will be fully removed in a future release. **It is strongly recommended to migrate to `modelProviders`** for all model and credential configurations. Use `envKey` in `modelProviders` to reference environment variables for secure credential management instead of hardcoding credentials in settings files.
|
||||
|
||||
## Generation Config Layering: The Impermeable Provider Layer
|
||||
|
|
@ -515,6 +522,7 @@ The snapshot:
|
|||
## Selection Persistence and Recommendations
|
||||
|
||||
> [!important]
|
||||
>
|
||||
> Define `modelProviders` in the user-scope `~/.qwen/settings.json` whenever possible and avoid persisting credential overrides in any scope. Keeping the provider catalog in user settings prevents merge/override conflicts between project and user scopes and ensures `/auth` and `/model` updates always write back to a consistent scope.
|
||||
|
||||
- `/model` and `/auth` persist `model.name` (where applicable) and `security.auth.selectedType` to the closest writable scope that already defines `modelProviders`; otherwise they fall back to the user scope. This keeps workspace/user files in sync with the active provider catalog.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue