本篇文章我们要介绍的是一个开源项目GPT4All,它是由 nomic-ai 团队精心打造的开源项目,已经在 GitHub 上赢得了超过 69.1k 颗星星,人气爆棚!
GPT4All 不仅仅是一个应用,通过图形化界面帮你在日常的桌面和笔记本电脑上私下运行大语言模型(LLM)。无需 API 调用或 GPU,你只需下载应用程序即可开始使用。GPT4All 提供了 Python 客户端,让你可以方便地访问 LLM。Nomic 团队为了让 LLM 对所有人都易于访问和高效,贡献了开源软件,如 llama.cpp。
工具特征
完全私有的桌面应用程序
支持 1000 多种型号和所有主要操作系统
由 Nomic Embed 提供支持的本地文档聊天
MIT 许可
① 跨平台兼容:无论是 Windows、macOS、Ubuntu,GPT4All 都能完美适配,让你的聊天随时随地触手可及。
② 数据安全:GPT4All 使用 Python 客户端,让你的聊天数据安全又自由。
GPT4All 支持 LLaMa、Mistral、Nous-Hermes 等数百种流行模型。
https://www.nomic.ai/gpt4all
Windows 和 Linux 需要 Intel Core i3 第 2 代 / AMD Bulldozer 或更高版本。仅限 x86-64,无 ARM。
pipinstallgpt4all
fromgpt4allimportGPT4Allmodel=GPT4All("Meta-Llama-3-8B-Instruct.Q4_0.gguf")#downloads/loadsa4.66GBLLMwithmodel.chat_session():print(model.generate("HowcanIrunLLMsefficientlyonmylaptop?",max_tokens=1024))#下载GPT4All模型并将其放置在您想要的目录中https://www.nomic.ai/gpt4all
模型调用
from langchain_community.llms import GPT4All# Instantiate the model. Callbacks support token-wise streamingmodel = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8)# Generate textresponse = model.invoke("Once upon a time, ")
流式调用
from langchain_community.llms import GPT4Allfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler# There are many CallbackHandlers supported, such as# from langchain.callbacks.streamlit import StreamlitCallbackHandlercallbacks = [StreamingStdOutCallbackHandler()]model = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8)# Generate text. Tokens are streamed through the callback manager.model.invoke("Once upon a time, ", callbacks=callbacks)
https://github.com/nomic-ai/gpt4all
| 欢迎光临 链载Ai (https://www.lianzai.com/) | Powered by Discuz! X3.5 |