🚀 Foundation-Sec-8B-Q8_0-GGUF模型卡片
Foundation-Sec-8B-Q8_0-GGUF是一个经过量化处理的模型,它解决了大内存占用的问题,在保留原模型网络安全专业能力的同时,大幅减少了推理时所需的内存。该模型对于需要进行网络安全相关文本处理的场景,如威胁情报分析、漏洞分类等,具有重要的应用价值。
🚀 快速开始
本模型是从 fdtn-ai/Foundation-Sec-8B 量化而来的8位(Q8_0)GGUF检查点,使用了llama.cpp进行量化操作。它保留了原80亿参数模型在网络安全领域的专业能力,同时将推理时的内存占用从约16GB(BF16)减少到了约8.54GB(Q8_0)。
✨ 主要特性
fdtn-ai/Foundation-Sec-8B-Q8_0-GGUF
是 Foundation-Sec-8B 的8位量化版本。Foundation-Sec-8B是一个基于LLaMA 3.1的80亿参数模型,在精心策划的网络安全特定文本语料库(如CVE、威胁情报报告、漏洞利用报告、合规指南等)上进行了持续预训练。基础模型最初于2025年4月28日以Apache 2.0许可证发布,擅长以下任务:
- 威胁情报总结(例如,总结CVE详细信息)
- 漏洞分类(将CVE/CWE映射到MITRE ATT&CK)
- 事件分类协助(提取IoC,总结日志数据)
- 红队模拟提示 和 安全工作流生成
如需了解基础架构、训练数据、评估结果和已知限制等详细信息,请参考原始模型卡片,而不是重新上传或复制整个训练细节。
🔧 技术细节
量化详情
- 量化方案:8位,“Q8_0”(8位量化,精度损失最小)
- 工具链:通过 llama.cpp的导出工具(提交版本
v0.1.81
或更新)转换为GGUF格式。
- 生成文件大小:磁盘上约8.54GB(原始GGUF二进制文件)
- 运行时占用:
- 内存:使用llama.cpp在CPU上加载时,约需8.54GB的RAM
- 格式:
- 文件扩展名:
.gguf
- 内部包含:
- 元数据(架构、分词器词汇表、超参数)
- 词汇表列表(BPE标记)
- 以8位量化形式存储的权重张量(每层和每个头)
- 兼容LlamaCpp Python包装器 (
llama_cpp
) 和C++命令行界面 (llama.cpp
) 推理引擎
📦 安装指南
在Mac上安装llama.cpp
使用Homebrew:
brew install llama-cpp
或者从头开始安装:
brew install cmake
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
make
sudo cp llama-cli /usr/local/bin/
💻 使用示例
基础用法
llama-cli -m foundation-sec-8b-q8_0.gguf -p "CVE-2021-44228 is a remote code execution flaw in Apache Log4j2 via unsafe JNDI lookups (\"Log4Shell\"). The CWE is CWE-502.\n\nCVE-2017-0144 is a remote code execution vulnerability in Microsoft's SMBv1 server (\"EternalBlue\") due to a buffer overflow. The CWE is CWE-119.\n\nCVE-2014-0160 is an information-disclosure bug in OpenSSL's heartbeat extension (\"Heartbleed\") due to out-of-bounds reads. The CWE is CWE-125.\n\nCVE-2017-5638 is a remote code execution issue in Apache Struts 2's Jakarta Multipart parser stemming from improper input validation of the Content-Type header. The CWE is CWE-20.\n\nCVE-2019-0708 is a remote code execution vulnerability in Microsoft's Remote Desktop Services (\"BlueKeep\") triggered by a use-after-free. The CWE is CWE-416.\n\nCVE-2015-10011 is a vulnerability about OpenDNS OpenResolve improper log output neutralization. The CWE is" -n 128
📚 详细文档
参考资料
- 原始模型卡片:
fdtn-ai/Foundation-Sec-8B (2025年4月28日) – 在网络安全数据上对LLaMA 3.1-8B进行持续预训练。
- Llama-cpp GGUF量化:
Ggerganov, J. (2022). Llama.cpp: Llama inference in pure C/C++/Assembly/GGUF. GitHub仓库。
- ZeroQuant:
Yao, Z. 等人 (2022). "ZeroQuant: Efficient and Affordable Post-Training Quantization for Large-Scale Transformers." arXiv: 2206.01861。
- SmoothQuant:
Xiao, G. 等人 (2022). "SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models." arXiv: 2211.10438。
📄 许可证
本模型遵循Apache 2.0许可证(与基础模型相同)。
⚠️ 重要提示
如需了解使用方法、量化细节或许可证条款相关问题,请在Hugging Face仓库中创建一个问题,或联系 paulkass@cisco.com
。