---
title: Meta-Llama-3-8B-Instruct-MNN
canonical_url: "https://www.modelscope.cn/models/MNN/Meta-Llama-3-8B-Instruct-MNN"
md_url: "https://www.modelscope.cn/models/MNN/Meta-Llama-3-8B-Instruct-MNN.md"
repository: MNN/Meta-Llama-3-8B-Instruct-MNN
last_updated: 2026-11-18
license: llama3
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - text-generation
library_name:
  - mnn
frameworks:
  - MNN
language:
  - zh
  - en
domain:
  - nlp
downloads: 77
stars: 0
---

# Meta-Llama-3-8B-Instruct-MNN

> Meta-Llama-3-8B-Instruct-MNN - MNN 在 ModelScope 开源的模型。Meta-Llama-3-8B-Instruct-MNN

MNN/Meta-Llama-3-8B-Instruct-MNN 是 ModelScope 魔搭社区上的text-generation模型，采用 llama3 许可。

- **Repository**: MNN/Meta-Llama-3-8B-Instruct-MNN
- **License**: llama3
- **Tasks**: text-generation
- **Downloads**: 77
- **Stars**: 0
- **Last updated**: 2026-11-18

Source: https://www.modelscope.cn/models/MNN/Meta-Llama-3-8B-Instruct-MNN

---

# Meta-Llama-3-8B-Instruct-MNN

[原始模型](https://modelscope.cn/models/LLM-Research/Meta-Llama-3-8B-Instruct) · [Hugging Face](https://huggingface.co/taobao-mnn/Meta-Llama-3-8B-Instruct-MNN) · [ModelScope](https://modelscope.cn/models/MNN/Meta-Llama-3-8B-Instruct-MNN) · [MNN](https://github.com/alibaba/MNN)

Meta Llama 3 的 8B 指令模型，用于对话和文本生成。本仓库提供其 MNN 量化版本。

## 模型信息

| 项目 | 配置 |
| --- | --- |
| 输入 / 输出 | 文本 / 文本 |
| 语言层数 / 隐藏维度 | 32 / 4096 |
| 语言权重 | HQQ 4-bit，分组 128 |
| 输出头 | HQQ 4-bit，分组 128 |
| 量化尺度 | FP16（语言线性层与输出头） |
| 词嵌入 | 独立 BF16 嵌入（`embeddings_bf16.bin`） |
| 默认运行配置 | CPU，4 线程，`precision=low`，`memory=low` |

模型文件包括 `llm.mnn` / `llm.mnn.weight`（模型图与权重）、`tokenizer.mtok`（分词器）、`config.json` / `llm_config.json`（运行与模型配置）、`embeddings_bf16.bin`（词嵌入）。下载时保留完整目录。

## 下载

Hugging Face：

```bash
hf download taobao-mnn/Meta-Llama-3-8B-Instruct-MNN --local-dir ./Meta-Llama-3-8B-Instruct-MNN
```

ModelScope：

```bash
modelscope download --model MNN/Meta-Llama-3-8B-Instruct-MNN --local_dir ./Meta-Llama-3-8B-Instruct-MNN
```

## 运行

运行时使用包含 [Jinja 模板与特殊 token 修复](https://github.com/alibaba/MNN/pull/5155) 的以下提交。

```bash
git clone https://github.com/alibaba/MNN.git
git -C MNN fetch origin pull/5155/head
git -C MNN checkout 4756b19d51ddeaf0a73bbc9f230dea6d930f442e
(cd MNN && ./schema/generate.sh)
cmake -S MNN -B MNN/build -DCMAKE_BUILD_TYPE=Release \
  -DMNN_BUILD_LLM=ON -DMNN_LOW_MEMORY=ON -DMNN_SUPPORT_TRANSFORMER_FUSE=ON
cmake --build MNN/build --target llm_demo -j4
```

```bash
printf '%s\n' '你好，请介绍一下自己。' > prompt.txt
./MNN/build/llm_demo ./Meta-Llama-3-8B-Instruct-MNN/config.json prompt.txt
```

采样参数在 `config.json` 中调整。应用集成见 [MNN-LLM 文档](https://mnn-docs.readthedocs.io/en/latest/transformers/llm.html)。

## 验证与导出

2026-11-17，x64 CPU：FP32 映射对齐、问候、算术与翻译用例及默认配置冒烟测试通过。

导出参数见 [export_args.json](export_args.json)，测试记录与文件哈希见 [refresh_metadata.json](refresh_metadata.json)。

## 许可证

采用 [Llama 3 Community License](LICENSE)，使用时还需遵守 [Acceptable Use Policy](USE_POLICY.md)。
