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

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# 运行 Qwen3.6-35B-A3B 在 RTX 5090 上

> Qwen3.6-35B-A3B（35B MoE，3B 活跃参数）在 NVIDIA RTX 5090（32 GB）上运行，可实现 ~90 tok/s 的 NVFP4 量化吞吐量。

Qwen3.6-35B-A3B 是 RTX 5090 的理想模型。它是一个 35B 参数的混合专家模型，每个 token 仅有 3B 活跃参数。在 Q6\_K 量化下，模型占用 \~28 GB——完全可以装入 RTX 5090 的 32 GB GDDR7 显存，并为 KV cache 留出空间。借助原生 FP4 张量核心，你可以获得 \~90 tok/s 的吞吐量。

本指南将带你完成模型下载、使用 vLLM 部署模型，以及通过 Tokios 向团队开放访问。

最后验证：2026-10-24

## 你将获得

* **模型：** Qwen3.6-35B-A3B（35B 总参数，每个 token 3B 活跃参数）
* **硬件：** 单张 NVIDIA RTX 5090（32 GB GDDR7）
* **吞吐量：** 使用 vLLM 达到 \~90 tok/s
* **上下文：** 32K+ tokens
* **显存占用：** 权重 \~28 GB，剩余 \~4 GB 用于 KV cache
* **适用场景：** 高速编码助手、对话、JSON 提取、智能体工作流

## 前提条件

* NVIDIA RTX 5090（32 GB），已安装 CUDA 12.x
* 850W+ 电源（RTX 5090 功耗为 575W）
* 用于下载模型权重的网络连接（\~28 GB）
* Tokios 账户（免费套餐即可）
* 20 分钟

> [!WARNING]
>
> **RTX 5090 供应与价格。** NVIDIA 已确认 RTX 5090 **未停产**——仍在生产中。但 GDDR7 短缺导致市场价超过 $4,000（建议零售价 $1,999）。如果能以接近建议零售价购买，请不要犹豫。可以考虑 **二手 RTX 4090**（\~\$1,600-2,000，同为 24 GB 显存）作为替代——它运行同一模型可达 \~65 tok/s，而非 \~90 tok/s。

## Step 1: 安装 vLLM

安装 vLLM v0.31.0 或更高版本（含 CUDA 支持）：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
pip install --upgrade vllm
```

验证安装和 CUDA 检测：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
vllm --version
nvidia-smi
```

你应该能看到 RTX 5090 已列出，显示 32 GB 显存和 CUDA 12.x 驱动。

## Step 2: 下载模型

RTX 5090 拥有原生 FP4 张量核心（Blackwell 架构）。使用 NVFP4 量化以获得最佳性能：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
huggingface-cli download Qwen/Qwen3.6-35B-A3B-NVFP4
```

下载大小约 \~18 GB。在普通家庭网络连接下，需要 10-20 分钟。

> [!NOTE]
>
> 如果你更倾向于使用 GGUF 格式配合 llama.cpp 或 Ollama，可以使用 `Qwen/Qwen3.6-35B-A3B-GGUF` 的 Q6\_K 量化版本（\~28 GB）。但推荐使用 NVFP4 量化在 RTX 5090 上，因为它由 Blackwell FP4 张量核心原生支持，性能比 GGUF 提升 20-40%。

## Step 3: 使用 vLLM 部署模型

使用 NVFP4 模型启动 vLLM 服务器：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
vllm serve Qwen/Qwen3.6-35B-A3B-NVFP4 \
  --host 127.0.0.1 \
  --port 8000 \
  --max-model-len 32768 \
  --gpu-memory-utilization 0.85
```

服务器约 \~20 秒内启动。你将看到：

```
INFO:     Started server process [12345]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000
```

测试端点：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.6-35B-A3B-NVFP4",
    "messages": [{"role": "user", "content": "Write a Python hello world"}],
    "max_tokens": 100
  }'
```

你应该在 \~1 秒内收到响应。

## Step 4: 基准测试性能

运行快速基准测试以验证吞吐量：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
python -m vllm.entrypoints.benchmark_serving \
  --backend vllm \
  --model Qwen/Qwen3.6-35B-A3B-NVFP4 \
  --dataset-name sonnet \
  --dataset-path sonnet.txt \
  --num-prompts 10 \
  --request-rate 1
```

RTX 5090 上的预期结果：

| 指标 | 数值 |
| - | - |
| 吞吐量（单用户） | \~90 tok/s |
| 首 token 延迟 | \~0.1s |
| 显存占用 | \~28 GB 权重 + \~3-4 GB KV cache |
| 显存余量 | \~0-1 GB（较为紧张） |

> [!TIP]
>
> RTX 5090 在此模型上快约 \~39%，相比 RTX 4090（90 vs 65 tok/s），得益于原生 FP4 张量核心和更高的显存带宽（1,792 vs 1,008 GB/s）。如果你从 RTX 4090 升级，将体验到显著的速度提升。

## Step 5: 连接 Tokios

你的模型已在 `127.0.0.1:8000` 上运行。要为团队提供远程访问并支持每用户 API key，请安装 Tokios connector。

### 安装 connector

从 [Tokios dashboard](https://tokios.com/console) 的 **Setup** 标签页获取你的 claim code，然后运行：

```bash theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/linux | sh -s -- --code TKS-XXXX-XXXX
```

```bash macOS theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/macos | sh -s -- --code TKS-XXXX-XXXX
```

```bash Windows (PowerShell) theme={"theme":{"light":"github-light","dark":"css-variables"}}
irm https://tokios.com/downloads/install/windows.ps1 | iex
```

### 认领 connector

在 dashboard 中，**approve** 该设备。然后配置 connector 指向 vLLM：

```json theme={"theme":{"light":"github-light","dark":"css-variables"}}
{
  "upstream": "http://127.0.0.1:8000/v1"
}
```

### 注册 deployment

在 **Models** 标签页中，将上游模型 id 映射到公开 deployment 名称：

* **上游模型 id：** `Qwen/Qwen3.6-35B-A3B-NVFP4`
* **Deployment 名称：** `qwen36-35b-rtx`

### 创建 API key

在 **Keys** 标签页中，为每位团队成员创建 key。将每个 key 的作用域限制为 `qwen36-rtx` deployment。

## Step 6: 从任意客户端使用

你的团队现在可以通过 OpenAI 兼容 API 从任何地方调用模型：

```python OpenAI SDK theme={"theme":{"light":"github-light","dark":"css-variables"}}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.tokios.com/v1",
    api_key="sk-tok-YOUR_KEY",
)

response = client.chat.completions.create(
    model="qwen36-35b-rtx",
    messages=[{"role": "user", "content": "Write a Python hello world"}],
)
print(response.choices[0].message.content)
```

```bash curl theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl https://api.tokios.com/v1/chat/completions \
  -H "Authorization: Bearer sk-tok-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen36-35b-rtx",
    "messages": [{"role": "user", "content": "Write a Python hello world"}]
  }'
```

```javascript OpenAI SDK theme={"theme":{"light":"github-light","dark":"css-variables"}}
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.tokios.com/v1',
  apiKey: 'sk-tok-YOUR_KEY',
});

const response = await client.chat.completions.create({
  model: 'qwen36-35b-rtx',
  messages: [{ role: 'user', content: 'Write a Python hello world' }],
});
console.log(response.choices[0].message.content);
```

## RTX 5090 还能运行哪些模型？

32 GB 显存可以容纳多种模型规格。其他选项请参阅完整的 [RTX 50 系列指南](https://docs.tokios.com/zh/guides/rtx-50-series-consumer.md)：

* **Qwen3-70B Q4 量化** — \~40 GB，配合 KV cache 较为紧张，\~23 tok/s
* **Qwen3.5-122B-A10B Q4 量化** — \~70 GB，无法装入（需要 2x RTX 5090）
* **Llama 3.1 32B Q4 量化** — \~18 GB，显存充裕，\~45 tok/s
* **同时运行多个 14B 模型** — 每个约 \~8 GB，可并行运行 2-3 个

## 故障排除

### vLLM 启动失败，提示 "CUDA out of memory"

将 `--gpu-memory-utilization` 从 0.85 降低到 0.80。RTX 5090 的 32 GB 显存对于 28 GB 模型较为紧张，vLLM 的性能分析可能会高估可用显存。

### 吞吐量低（\<70 tok/s）

确保你使用的是 NVFP4 量化，而非 GGUF。NVFP4 由 Blackwell FP4 张量核心原生支持，性能提升 20-40%。同时确认你使用的是 vLLM v0.31.0 或更高版本。

### 系统不稳定或崩溃

RTX 5090 功耗为 575W。确保你的电源能够承受（推荐 850W+），并且机箱散热充足。在推理过程中使用 `nvidia-smi dmon` 监控温度。

### 长上下文时 KV cache 耗尽

将 `--max-model-len` 从 32768 降低到 16384 或 8192。32 GB 显存较为紧张，长上下文会消耗大量 KV cache 显存。

## 后续步骤

* [RTX 50 系列消费级指南](https://docs.tokios.com/zh/guides/rtx-50-series-consumer.md) — 完整的 RTX 5090/5080/5070 对比
* [团队访问本地模型](https://docs.tokios.com/zh/use-cases/team-access.md) — 为团队提供 API 访问权限
* [什么是本地 LLM？](https://docs.tokios.com/zh/guides/what-is-local-llm.md) — 本地运行 LLM 的完整指南
* [模型适配计算器](https://docs.tokios.com/zh/guides/model-fit.md) — 检查你的硬件能运行哪些模型


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.