部署 DeepSeek-R1 蒸馏模型
GPU 服务器
T4 GPU 服务器,4卡16G。
安装 vLLM
conda create -n deepseek-r1 python=3.12 -y
conda activate deepseek-r1
pip install vllm
错误处理
ImportError: undefined symbol: __nvJitLinkComplete_12_4, version libnvJitLink.so.12
GPU 服务器
T4 GPU 服务器,4卡16G。
安装 vLLM
conda create -n deepseek-r1 python=3.12 -y
conda activate deepseek-r1
pip install vllm
错误处理
ImportError: undefined symbol: __nvJitLinkComplete_12_4, version libnvJitLink.so.12
沐曦训练芯片 MXC500 介绍
曦云®C500是沐曦面向通用计算的旗舰产品,提供强大高精度及多精度混合算力,配备大规格高带宽显存,片间互联MetaXLink无缝链接多GPU系统,自主研发的MXMACA®软件栈可兼容主流GPU生态,能够全面满足数字经济建设和产业数字化的算力需求。
2023 年 6 月 14 日,沐曦官宣 AI 训练 GPU MXC500 完成芯片功能测试,MXMACA 2.0 计算平台基础测试完成,意味着公司首款 AI 训练芯片 MXC500成功点亮,该芯片采用 7nm 制程,GPGPU 架构,能够兼容 CUDA,目标对标英伟达 A100/A800 芯片。
沐曦主要有三大产品线:
研发实力强大,软件生态布局完善。沐曦的研发团队阵容豪华,三位创始人均在 AMD 拥有 20 年左右的 GPU 研发经验,其中两位为 AMD 科学家(Fellow)。沐曦采用了完全自主研发的 GPU IP,有效提高了产品的开发效率,同时拥有完全自主知识产权的指令集和架构,可以对每个独立的计算实例进行灵活配置,从而优化数据中心计算资源的效率。
ABSTRACT(摘要)
Language models have outpaced our ability to evaluate them effectively, but for their future development it is essential to study the frontier of their capabilities. We find real-world software engineering to be a rich, sustainable, and challenging testbed for evaluating the next generation of language models. To this end, we introduce SWE-bench, an evaluation framework consisting of 2,294 software engineering problems drawn from real GitHub issues and corresponding pull requests across 12 popular Python repositories.
Developing a computer use model(开发计算机使用模型)
Claude can now use computers. The latest version of Claude 3.5 Sonnet can, when run through the appropriate software setup, follow a user’s commands to move a cursor around their computer’s screen, click on relevant locations, and input information via a virtual keyboard, emulating the way people interact with their own computer.
Claude现在可以使用计算机了。最新版本的Claude 3.5 Sonnet可以在通过适当的软件设置后,按照用户的命令在计算机屏幕上移动光标,单击相关位置,并通过虚拟键盘输入信息,模拟人们与自己的计算机交互的方式。
We think this skill—which is currently in public beta—represents a significant breakt
参考
Abstract(摘要)
Autonomous agents that accomplish complex computer tasks with minimal human interventions have the potential to transform human-computer interaction, significantly enhancing accessibility and productivity. However, existing benchmarks either lack an interactive environment or are limited to environments specific to certain applications or domains, failing to reflect the diverse and complex nature of real-world computer use, thereby limiting the scope of tasks and agent scalability.
UI-TARS: Pioneering Automated GUI Interaction with Native Agents(与本地代理进行自动化 GUI 交互的先驱)
Abstract(摘要)
This paper introduces UI-TARS, a native GUI agent model that solely perceives the screenshots as input and performs human-like interactions (e.g., keyboard and mouse operations). Unlike prevailing agent frameworks that depend on heavily wrapped commercial models (e.g., GPT-4o) with expert-crafted prompts and workflows, UI-TARS is an end-to-end model that outperforms these sophisticated frameworks.
Abstract(摘要)
We present DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token. To achieve efficient inference and cost-effective training, DeepSeek-V3 adopts Multi-head Latent Attention (MLA) and DeepSeekMoE architec- tures, which were thoroughly validated in DeepSeek-V2. Furthermore, DeepSeek-V3 pioneers an auxiliary-loss-free strategy for load balancing and sets a multi-token prediction training objective for stronger performance. We pre-train DeepSeek-V3 on 14.
Abstract(摘要)
We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1. DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without super- vised fine-tuning (SFT) as a preliminary step, demonstrates remarkable reasoning capabilities. Through RL, DeepSeek-R1-Zero naturally emerges with numerous powerful and intriguing reasoning behaviors. However, it encounters challenges such as poor readability, and language mixing.
什么是 CodeGate
CodeGate 是位于 AI 编码助手和 LLM 之间的本地提示网关,用于增强隐私和安全性。
工作原理
CodeGate 是位于 AI 编码助手和 LLM 之间的本地代理。CodeGate 会审查您的提示是否存在任何潜在的机密泄露 — 在机密离开您的桌面之前对其进行加密,并在响应中对其进行解密。CodeGate 使用 RAG 来更新任何 LLM 的知识库,并提供相关的风险洞察。

Continue 指南
启动 CodeGate 服务
docker pull ghcr.io/stacklok/codegate:latest
docker run --name codegate -d -p 8989:8989 -p 9090:9090 --restart unless-stopped ghcr.io/stacklok/codegate:latest
下载 Ollama 代码模型
ollama pull qwen2.5-coder:7b
ollama pull qwen2.5-coder:1.5b
配置 Continue 扩展
编辑配置文件:~/.continue/config.json
菜单
创建 Notebook
工作目录:/home/ma-user/work
下载模型
安装 modelscope
pip install --upgrade modelscope
SDK 下载模型脚本
编辑 download.py 文件
#模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('Qwen/Qwen1.5-7B-Chat')
设置下载路径
export MODELSCOPE_CACHE=/home/ma-user/work
下载
python download.py
查看下载的模型
ll /home/ma-user/work/hub/Qwen/Qwen1___5-7B-Chat
修改模型配置文件
修改配置文件:Qwen/Qwen1___5-7B-Chat/config.json
{
"torch_dtype": "float16",
}
NPU 不支持 bfloat16,模型配置文件需要修改为 float16。
算力切分
查询算力切分模式
sudo npu-smi info -t vnpu-mode
vnpu-mode : docker
查询算力切分模板信息 sudo npu-smi info -t template-info +------------------------------------------------------------------------------------------+ |NPU instance template info is: | |Name AICORE Memory AICPU VPC VENC JPEGD | | GB PNGD VDEC JPEGE | |==========================================================================================| |vir10_3c_16g 10 16 3 4 0 12 | | 0 1 2 | +------------------------------------------------------------------------------------------+ |vir10_4c_16g_m 10 16 4 9 0 24 | | 0 2 4 | +---------------------------
“什么是代理?”
几乎每天都会有人问我这个问题。在 LangChain,我们构建工具来帮助开发者构建 LLM 应用程序,特别是那些充当推理引擎并与外部数据和计算源交互的应用程序。这包括通常被称为“代理”的系统。
每个人似乎对代理都有稍微不同的定义。我的定义可能比大多数人更技术性:
💡 代理是一个使用 LLM 来决定应用程序控制流的系统。
即使在这里,我也承认我的定义并不完美。人们通常认为代理是高级的、自主的、类人的——但如果是一个简单的系统,LLM 在两个不同路径之间进行路由呢?这符合我的技术定义,但不符合人们对代理应具备能力的普遍看法。很难准确定义什么是代理!
这就是为什么我非常喜欢 Andrew Ng 上周的推文。在推文中,他建议“与其争论哪些工作应被包括或排除为真正的代理,我们可以承认系统可以有不同程度的代理性。”就像自动驾驶汽车有不同的自动化级别一样,我们也可以将代理能力视为一个光谱。我非常同意这个观点,我认为 Andrew 表达得很好。将来,当有人问我什么是代理时,我会转而讨论什么是“代理性”。
什么是代理性(agentic)?
去年我在 TED 演讲中谈到了 LLM 系统,并使用下面的幻灯片讨论了 LLM 应用程序中存在的不同自主级别。

一个系统越“代理性”,LLM 决定系统行为的程度就越高。
使用 LLM 将输入路由到特定的下游工作流中具有一些小的“
本文档的专注点是如何将样本从 几千 扩展到 数百万,从而使其可用于 从头开始预训练 LLM。深入研究了创建数据集的方法、提示整编的方法及相应的技术栈。
Cosmopedia
Cosmopedia 的目的是重现 Phi-1.5 所使用的训练数据。
围绕在 Phi 数据集上的谜团除了我们对其如何创建的不甚了了之外,还有一个问题是其数据集的生成使用的是私有模型。为了解决这些问题,我们引入了 Cosmopedia,这是由 Mixtral-8x7B-Instruct-v0.1 生成的包含教科书、博文、故事、帖子以及 WikiHow 文章等各种体裁的合成数据集。其中有超过 3000 万个文件、250 亿个词元,是迄今为止最大的开放合成数据集。
实际上 Cosmopedia 的大部分时间都花在了细致的提示词工程上了。
Tab Completion

输入

Langfuse
LLM 可观察性(LLM Observability)、提示管理(Prompt Management)、LLM 评估(LLM Evaluations)、数据集(Datasets)、LLM 指标(LLM Metrics)和提示游乐场(Prompt Playground)
概述(Overview)
开发(Develop)
监控(Monitor)
LiteLLM Proxy Server (LLM Gateway)
安装
pip install 'litellm[proxy]'
编辑配置文件:config.yaml
model_list:
- model_name: qwen-coder
litellm_params:
model: ollama/qwen2.5-coder:7b
- model_name: bge-m3
litellm_params:
model: ollama/bge-m3
- model_name: llava
litellm_params:
model: ollama/llava:7b
api_base: "http://localhost:11434"
# api_base: http://127.0.0.1:11434/v1 # ❌ 500 Internal Server Error
- model_name: gpt-4
litellm_params:
model: openai/gpt-4-32k
// ...
命令部署 # 集成 Langfuse LANGFUSE_PUBLIC_KEY=pk-lf-fd5d8fb
Kong

更快地构建生产就绪的 AI 应用程序(对于开发人员)
通过简单更改一行代码,使用现代基础设施构建具有多 LLM 支持和路由、高级 AI 负载均衡、LLM 可观察性、LLM 安全性和治理等功能的语义智能 AI 应用程序。

将语义智能注入到您的 AI 应用程序中(对于平台团队)
通过语义缓存加速每个 AI 应用程序,通过语义路由智能地跨多个模型路由,构建高级提示模板,检测和防止滥用,以及 AI 可观察性。

AI 流量的 L7 可观察性,用于成本监控和调优(AI 指标和可观察性)
获取应用程序发送的每个 AI 请求的见解,并捕获详细信息以了解和优化您的 AI 使用和成本,支持 10 多个日志摄取器。

安装(Docker)
PostgreSQL docker run -d --name kong-database \ -p 5432:5432 \ -e "POSTGRES_USER=kong" \ -e "POSTGRES_DB=kong" \ -e &q
Higress
Higress 是基于阿里内部多年的 Envoy Gateway 实践沉淀,以开源 Istio 与 Envoy 为核心构建的云原生 API 网关。
安装

transformers 库进行推理,对于 vLLM,由于 GPU 显存预分配,实际显存使用难以评估。计算加载模型需要的显存
| 模型参数(B) | 参数使用的位数(bits) | 加载需要显存(G) |
|---|---|---|
| 0.5 | 16 | 1 |
| 1.5 | 16 | 3 |
| 7 | 16 | 14 |
| 9 | 16 | 18 |
| 22 | 16 | 44 |
| 72 | 16 | 144 |
计算支持不同长度的上下文需要的显存
RAG 复杂场景下的工作流程
召回模式(选择数据集) → 混合检索(同时进行语义检索和关键词搜索) → 重排序(合并和归一化检索结果)
RAG 中构建知识库的解析方法
RAGFlow 是一款基于深度文档理解构建的开源 RAG 引擎,内置了丰富地文档解析方法,可以帮助用户快速构建知识库。