> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valkyrieapp.azumo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen Code

> Use a Valkyrie model in the Qwen Code CLI over the OpenAI-compatible API.

[Qwen Code](https://github.com/QwenLM/qwen-code) is an OpenAI-compatible coding CLI.
You can point it at a Valkyrie deployment with a few environment variables, or with a
settings file if you want it saved.

## Quick setup with environment variables

```bash theme={null}
export OPENAI_API_KEY="vk_dep_your_deployment_key"
export OPENAI_BASE_URL="https://valkyrie-back.azumo.com/{deployment_slug}/v1"
export OPENAI_MODEL="your-model-id"

qwen
```

Environment variables take priority. You can also put them in `~/.qwen/.env` (or
`./.qwen/.env` for a single project).

## Saved setup with settings.json

To keep the config, add a provider to `~/.qwen/settings.json`:

```json theme={null}
{
  "modelProviders": {
    "openai": [
      {
        "id": "RadixArk/Qwen3.8-27B-NVFP4",
        "name": "Valkyrie Qwen 27B",
        "envKey": "VALKYRIE_API_KEY",
        "baseUrl": "https://valkyrie-back.azumo.com/qwen/v1",
        "generationConfig": {
          "contextWindowSize": 131072,
          "samplingParams": { "max_tokens": 16384 }
        }
      }
    ]
  },
  "security": { "auth": { "selectedType": "openai" } },
  "model": { "name": "RadixArk/Qwen3.8-27B-NVFP4" }
}
```

`envKey` names the environment variable that holds your key, so the key itself stays
out of the file.

<Note>
  The base URL ends in `/v1`. Use your deployment slug (`deployment-{id}`) or an
  [alias](/guides/aliases), and set the model id to what your deployment serves.
</Note>
