OpenChat(8,984星)2026:可微调、可本地运行的开源聊天模型家族
OpenChat(8,984星)是开源聊天模型家族,以混合数据训练出强性能著称。本文教你如何运行和微调它们。
💡 你将学到
OpenChat(8,984星)是开源聊天模型家族,以混合数据训练出强性能著称。本文教你如何运行和微调它们。
直接给结论
togethercomputer/OpenChat(8,984星,Python)是开源聊天模型库和模型家族。它开创了"混合"训练方法——把指令数据、偏好数据和通用对话结合起来——训练出的模型表现超出其体量。
为什么OpenChat受关注
- 小模型强性能:OpenChat-3.5(7B)在众多基准上能与大得多的模型竞争
- 训练方法简单:混合数据微调方法有文档、可复现
- 服务方便:自带OpenAI兼容API服务器
- 本地友好:7B模型消费级显卡可跑
本地运行
方式一——用Transformers(163,376星):
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("openchat/openchat-3.5-1210")
model = AutoModelForCausalLM.from_pretrained("openchat/openchat-3.5-1210", torch_dtype="auto")
方式二——用内置API服务:
git clone https://github.com/imoneoi/openchat.git
cd openchat && pip install -e .
python -m openchat.server --model openchat/openchat-3.5-1210
# OpenAI兼容端点 http://localhost:18888
微调要点
- 仓库提供
finetune脚本,包含OpenChat-3.5使用的精确数据配比。 - 支持LoRA式高效微调,消费级显卡可跑。
- 先从7B基础模型开始,在你的任务上评估后再扩大。
FAQ
免费吗? 是——模型和训练代码开源(代码为Apache-2.0)。
能商用吗? 请查看每个模型卡的许可证;基础模型许可各不相同。
和Llama比怎么样? OpenChat通常在Llama/Mistral基础上加自己的混合数据配方训练——性能取决于基础模型。
相关文章
❓ 常见问题
Is it free?
Yes - the models and training code are open source (Apache-2.0 for the code).
Can I use it commercially?
Check each model card license; base model licenses vary.
How does it compare to Llama?
OpenChat is often trained on top of Llama/Mistral bases, adding its mixed-data recipe - performance depends on the base model.
本站文章由编辑人工撰写,收录的工具均经过实测或公开资料核验。文中链接指向工具官网或 GitHub 仓库,仅作信息参考,不构成付费推广。
