---
title: 鲲鹏CPU平台
description: "为了保证模型推理性能，推荐表1中指定量化版本的Embedding模型，本节以bce-embedding-base_v1模型为例，介绍在鲲鹏CPU平台部署Embedding服务的步骤。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengrag/bestpractice/kunpengrag_21_0055.html
sourcePath: /source/zh/kunpengrag/bestpractice/kunpengrag_21_0055.html
indexId: e0398b61f66ee10a19f1ee59eefae83c4343bff953434838fe3d1fe184773bc858
---
# 鲲鹏CPU平台

为了保证模型推理性能，推荐表1中指定量化版本的Embedding模型，本节以bce-embedding-base_v1模型为例，介绍在鲲鹏CPU平台部署Embedding服务的步骤。


**表1 推荐Embedding模型说明**

| 模型名称 | 支持语言 | 参数规模 | 最大输入/tokens | 下载链接 |
| --- | --- | --- | --- | --- |
| bce\-embedding\-base\_v1\-f16.gguf | 中文、英文 | 0.28B | 512 | 下载链接(https://huggingface.co/qmaru/bce\-embedding\-base\_v1\-gguf/blob/main/bce\-embedding\-base\_v1\-f16.gguf) |
| bge\-m3\-FP16.gguf | 多语言 | 0.57B | 8192 | 下载链接(https://huggingface.co/qmaru/bce\-embedding\-base\_v1\-gguf/blob/main/bce\-embedding\-base\_v1\-f16.gguf) |
| ritrieve\_zh\_v1.f16.gguf | 中文 | 0.32B | 8192 | 下载链接(https://huggingface.co/mradermacher/ritrieve\_zh\_v1\-GGUF/blob/main/ritrieve\_zh\_v1.f16.gguf) |


1. 从huggingface国内镜像网站(https://hf-mirror.com/)复制模型名称并搜索，下载对应的Embedding模型。选择GGUF格式的量化版本模型bce-embedding-base_v1-f16.gguf，下载到本地后上传至服务器“/root/models”目录下。
2. 下载已经基于鲲鹏CPU编译适配好的llama.cpp推理框架的Docker镜像。

  - 鲲鹏920处理器：swr.cn-north-4.myhuaweicloud.com/kunpeng-ai/llama.cpp:920-kunpeng
  - 鲲鹏920新型号处理器：swr.cn-north-4.myhuaweicloud.com/kunpeng-ai/llama.cpp:920B-kunpeng
以鲲鹏920处理器为例：
```
docker pull swr.cn-north-4.myhuaweicloud.com/kunpeng-ai/llama.cpp:920-kunpeng
```


3. 运行以下命令，启动llama.cpp镜像并运行Embedding模型推理服务。

```
docker run \
--cpuset-cpus="0-31" \                           # 容器绑核，绑定一个numa上
-v /root/models:/models \                        # 挂载模型目录到容器
-p 11133:11133                                   # 映射容器的服务端口到主机端口
swr.cn-north-4.myhuaweicloud.com/kunpeng-ai/llama.cpp:920-kunpeng \                # 使用已构建好的llama.cpp镜像
--server \                                       # 启动api服务
-m /models/bce-embedding-base_v1-f16.gguf \ # 指定模型路径
--embedding \
--port 11133 \
--threads 32 \
--host 0.0.0.0 \
--ubatch-size 1024
```


4. 从客户端访问Embedding服务API，IP地址和端口需修改为对应服务器的IP地址和端口。

```
curl -X
POST
http:
//127.0.0.1:11133/v1/embeddings -H "Content-Type: application/json" -d '{
"model": "bce-embedding-base_v1-FP16.gguf",
"input": "Why is the sky blue?"
}'
```


  若能成功返回嵌入向量值，则部署成功。
