# Ling-2.5-1T（1 万亿参数）

蚂蚁集团的 Ling-2.5-1T（于 2026 年 2 月 16 日发布）是有史以来发布的最大开源语言模型之一 — **总参数量 1 万亿，激活参数 630 亿**。它引入了一种混合线性注意力架构，使得在最长可达 100 万 token 的上下文长度上能够高效推理。与此同时，蚂蚁集团发布了 Ring-2.5-1T，全球首个混合线性架构的思考模型。二者共同代表了开源 AI 的新前沿——在推理与代理基准上可与 GPT-5.2、DeepSeek V3.2 和 Kimi K2.5 相抗衡。

**HuggingFace：** [inclusionAI/Ling-2.5-1T](https://huggingface.co/inclusionAI/Ling-2.5-1T) **配套模型：** [inclusionAI/Ring-2.5-1T](https://huggingface.co/inclusionAI/Ring-2.5-1T) （思考/推理 变体） **许可：** 开源（蚂蚁集团 InclusionAI 许可）

## 主要特性

* **总参数 1 万亿，激活参数 630 亿** — 大规模且采用高效的 MoE 风格激活
* **混合线性注意力** — 将 MLA（多头线性注意力）与 Lightning Linear Attention 结合，在长序列上提供卓越吞吐量
* **100 万 token 上下文窗口** — 通过 YaRN 从原生 256K 扩展，能够处理整个代码库和书籍长度的文档
* **前沿推理能力** — 在使用约 4× 更少输出 token 的情况下，接近思考模型的表现
* **代理能力** — 使用 Agentic 强化学习训练，兼容 Claude Code、OpenCode 和 OpenClaw
* **Ring-2.5-1T 配套模型** — 专用的推理变体达到了 IMO 2025 和 CMO 2025 的金牌水平

## 架构详情

| 组件    | 详细信息                            |
| ----- | ------------------------------- |
| 参数总量  | 1T（1,000B）                      |
| 激活参数  | 63B                             |
| 架构    | 混合线性注意力（MLA + Lightning Linear） |
| 预训练数据 | 29T token                       |
| 原生上下文 | 256K token                      |
| 扩展上下文 | 1M token（YaRN）                  |
| 发布日期  | 2026 年 2 月 16 日                 |

## 需求

以全精度运行 Ling-2.5-1T 需要大量资源。量化版本使其更易获取。

| 配置   | 量化（Q4 GGUF）   | FP8           | BF16（全精度）       |
| ---- | ------------- | ------------- | --------------- |
| GPU  | 8× RTX 4090   | 8× H100 80GB  | 16× H100 80GB   |
| 显存   | 8×24GB（192GB） | 8×80GB（640GB） | 16×80GB（1.28TB） |
| 内存   | 256GB         | 512GB         | 1TB             |
| 磁盘   | 600GB         | 1.2TB         | 2TB+            |
| CUDA | 12.0+         | 12.0+         | 12.0+           |

**推荐的 Clore.ai 配置：**

* **量化（Q4）：** 8× RTX 4090（约 $4–16/天）— 适用于实验和中等负载
* **生产（FP8）：** 8× H100（约 $24–48/天）— 全质量且吞吐良好
* **注意：** 这是一个极其庞大的模型。对于预算敏感的用户，考虑 Ling 家族中更小的模型，见 [HuggingFace](https://huggingface.co/inclusionAI).

## vLLM 快速入门

vLLM 是推荐用于 Ling-2.5-1T 的服务框架：

```bash
# 安装 vLLM
pip install vllm

# 在 8 张 GPU 上使用张量并行部署 Ling-2.5-1T
vllm serve inclusionAI/Ling-2.5-1T \
    --tensor-parallel-size 8 \
    --max-model-len 65536 \
    --gpu-memory-utilization 0.90 \
    --trust-remote-code \
    --host 0.0.0.0 \
    --port 8000

# 若要减少内存，限制上下文长度：
vllm serve inclusionAI/Ling-2.5-1T \
    --tensor-parallel-size 8 \
    --max-model-len 16384 \
    --gpu-memory-utilization 0.95 \
    --trust-remote-code \
    --host 0.0.0.0 \
    --port 8000
```

## 使用 llama.cpp 的快速入门（量化）

对于消费级 GPU 设置，可用 GGUF 量化：

```bash
# 安装 llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j$(nproc)

# 下载量化后的 GGUF（在 HuggingFace 检查可用量化文件）
huggingface-cli download inclusionAI/Ling-2.5-1T-GGUF \
    --include "*.Q4_K_M.gguf" \
    --local-dir ./models/

# 使用 llama-server 提供服务（根据你的 GPU 数量调整 -ngl）
./build/bin/llama-server \
    -m ./models/Ling-2.5-1T-Q4_K_M.gguf \
    -ngl 99 \
    -c 8192 \
    --host 0.0.0.0 \
    --port 8000
```

## 使用示例

### 1. 通过 OpenAI API 的聊天补全

一旦 vLLM 或 llama-server 正在运行：

```python
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="not-needed"
)

response = client.chat.completions.create(
    model="inclusionAI/Ling-2.5-1T",
    messages=[
        {"role": "system", "content": "You are a world-class reasoning assistant. Think step by step."},
        {"role": "user", "content": "Prove that the square root of 2 is irrational."}
    ],
    temperature=0.1,
    max_tokens=4096
)

print(response.choices[0].message.content)
```

### 2. 长上下文文档分析

Ling-2.5-1T 的混合线性注意力使其在处理长文档时极为高效：

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="n/a")

# 加载大型文档
with open("full_codebase.txt", "r") as f:
    codebase = f.read()  # 可能包含数十万 token

response = client.chat.completions.create(
    model="inclusionAI/Ling-2.5-1T",
    messages=[
        {"role": "system", "content": "You are a senior software architect."},
        {"role": "user", "content": f"Analyze this codebase for security vulnerabilities and architectural issues:\n\n{codebase}"}
    ],
    temperature=0.1,
    max_tokens=8192
)

print(response.choices[0].message.content)
```

### 3. 代理工具使用

Ling-2.5-1T 使用 Agentic 强化学习训练以支持工具调用：

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="n/a")

tools = [
    {
        "type": "function",
        "function": {
            "name": "search_database",
            "description": "Search the product database",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string"},
                    "category": {"type": "string", "enum": ["electronics", "clothing", "books"]},
                    "max_price": {"type": "number"}
                },
                "required": ["query"]
            }
        }
    }
]

response = client.chat.completions.create(
    model="inclusionAI/Ling-2.5-1T",
    messages=[{"role": "user", "content": "Find me a laptop under $1000 with good reviews"}],
    tools=tools,
    tool_choice="auto"
)

print(response.choices[0].message.tool_calls)
```

## Ling-2.5-1T 与 Ring-2.5-1T 对比

| 方面       | Ling-2.5-1T    | Ring-2.5-1T    |
| -------- | -------------- | -------------- |
| 类型       | 即时（快速）模型       | 思考（推理）模型       |
| 架构       | 混合线性注意力        | 混合线性注意力        |
| 最适合      | 通用聊天、编程、代理任务   | 数学、形式推理、复杂问题   |
| 输出风格     | 直接回答           | 链式思维推理         |
| Token 效率 | 高（输出 token 较少） | 在推理时使用更多 token |
| IMO 2025 | 有竞争力           | 金牌级别           |

## 给 Clore.ai 用户的提示

1. **该模型需要强大的硬件** — 在 1T 参数规模下，即使是 Q4 量化也需要约 500GB 存储和 192GB+ 显存。下载前请确保你的 Clore.ai 实例有足够的磁盘空间和多 GPU 配置。
2. **从以下设置开始 `--max-model-len 8192`** — 初次测试时使用较短的上下文以验证模型能正确加载并运行。确认无误后再扩大上下文长度。
3. **使用持久化存储** — 该模型大小在 1–2TB。为避免重复下载，在 Clore.ai 上挂载大容量持久卷。只需下载一次，使用 `huggingface-cli download`.
4. **对于推理任务，考虑使用 Ring-2.5-1T** — 如果你的用例主要是数学、逻辑或形式推理，配套的 Ring-2.5-1T 模型专为链式思维推理优化。
5. **监控 GPU 内存** — 在 8 GPU 配置下，使用 `nvidia-smi -l 1` 来监控内存使用情况，并在长上下文生成时注意是否出现 OOM。

## 故障排除

| 问题                         | 解决方案                                                                                           |
| -------------------------- | ---------------------------------------------------------------------------------------------- |
| `CUDA 内存不足（out of memory）` | 减少 `--max-model-len`；确保 `--tensor-parallel-size` 与 GPU 数量匹配；尝试 `--gpu-memory-utilization 0.95` |
| 生成非常慢                      | 线性注意力需要热身；前几次请求可能较慢。另外检查 GPU 之间是否有 NVLink                                                      |
| 模型下载失败                     | 模型 BF16 大小约为 2TB。请确保有足够磁盘空间。使用 `--resume-download` 标志与 `huggingface-cli`                       |
| vLLM 不支持该架构                | 确保你使用 vLLM ≥0.7.0 并带上 `--trust-remote-code`；自定义注意力层需要此标志                                       |
| GGUF 不可用                   | 检查 [unsloth](https://huggingface.co/unsloth) 或社区量化；该模型可能需要社区一段时间来完成量化                          |
| 响应质量差                      | 对于事实型任务使用 temperature ≤0.1；添加系统提示；确保没有截断上下文                                                    |

## 延伸阅读

* [官方公告（BusinessWire）](https://www.businesswire.com/news/home/20260215551663/en/) — 发布详情与基准
* [HuggingFace — Ling-2.5-1T](https://huggingface.co/inclusionAI/Ling-2.5-1T) — 模型权重与文档
* [HuggingFace — Ring-2.5-1T](https://huggingface.co/inclusionAI/Ring-2.5-1T) — 思考模型配套
* [ModelScope 镜像](https://www.modelscope.cn/models/inclusionAI/Ling-2.5-1T) — 亚洲地区更快的下载
* [vLLM 文档](https://docs.vllm.ai/) — 服务框架


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-zh/yu-yan-mo-xing/ling25.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
