diff --git a/docs/users/configuration/model-providers.md b/docs/users/configuration/model-providers.md index 2e6265917..8a63f4190 100644 --- a/docs/users/configuration/model-providers.md +++ b/docs/users/configuration/model-providers.md @@ -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. diff --git a/docs/users/features/commands.md b/docs/users/features/commands.md index 9a3b2c051..7e502d26a 100644 --- a/docs/users/features/commands.md +++ b/docs/users/features/commands.md @@ -121,7 +121,9 @@ Environment Variables: Commands executed via `!` will set the `QWEN_CODE=1` envi Save frequently used prompts as shortcut commands to improve work efficiency and ensure consistency. -> **Note:** Custom commands now use Markdown format with optional YAML frontmatter. TOML format is deprecated but still supported for backwards compatibility. When TOML files are detected, an automatic migration prompt will be displayed. +> [!note] +> +> Custom commands now use Markdown format with optional YAML frontmatter. TOML format is deprecated but still supported for backwards compatibility. When TOML files are detected, an automatic migration prompt will be displayed. ### Quick Overview @@ -140,7 +142,7 @@ Priority Rules: Project commands > User commands (project command used when name | File Location | Generated Command | Example Call | | -------------------------- | ----------------- | --------------------- | | `~/.qwen/commands/test.md` | `/test` | `/test Parameter` | -| `/git/commit.md` | `/git:commit` | `/git:commit Message` | +| `/commands/git/commit.md` | `/git:commit` | `/git:commit Message` | Naming Rules: Path separator (`/` or `\`) converted to colon (`:`) @@ -164,6 +166,8 @@ Use {{args}} for parameter injection. ### TOML File Format (Deprecated) +> [!warning] +> > **Deprecated:** TOML format is still supported but will be removed in a future version. Please migrate to Markdown format. | Field | Required | Description | Example | @@ -225,8 +229,6 @@ Please generate a Commit message based on the following diff: ``` ```` -```` - #### 4. File Content Injection (`@{...}`) | File Type | Support Status | Processing Method | @@ -246,7 +248,7 @@ description: Code review based on best practices Review {{args}}, reference standards: @{docs/code-standards.md} -```` +``` ### Practical Creation Example