我如何在笔记本运行GPT-4级别的模型

Meta的新模型Llama 3.3 70B是一个真正的GPT-4级别的大型语言模型,它可以在我的笔记本电脑上运行。

仅仅在20个月前,我还在为能在同一台机器上运行感觉达到GPT-3级别的模型而感到惊讶。在过去的两年里,能够在消费级硬件上访问的模型质量有了巨大的提升。

我的笔记本电脑是一台64GB的MacBook Pro M2,我在2023年1月购买的——这是在ChatGPT最初发布两个月后。我所有在笔记本电脑上运行大型语言模型(LLM)的实验都使用了这台机器。

How I ran Llama 3.3 70B on my machine using Ollama

我不认为这个模型在少于我64GB的RAM下能很好地工作。我第一次尝试时,它消耗了所有剩余的可用内存,导致我的Mac崩溃了!第二次尝试时,我确保不要同时运行Firefox和VS Code,它就正常工作了。

我使用了Ollama。安装它,然后运行这个命令来获取模型:

ollama pull llama3.3

这将42GB的数据获取到我的~/.ollama/models/blobs目录中。

我使用我的LLM工具来运行提示,因为这样既可以自动将提示和响应记录到SQLite数据库中。首先我安装了llm-ollama插件:

llm install llm-ollama

然后在Ollama本地服务器运行的情况下,我可以运行这个命令:

llm models

并在列表中看到:

Ollama: llama3.3:latest (别名:lamma3.3)

Putting the model through its paces

这意味着我可以这样运行提示:

llm -m llama3.3 'Write a letter to the mayor of Half Moon Bay CA advocating for the installation of cosy boxes for Pelicans in the harbor'

并得到这样的回应开头:

[Your Name]
[Your Address]
Half Moon Bay, CA [Zip Code]
[Email Address]
[Phone Number]
[Date]
The Honorable Mayor, Deborah Penrose
City of Half Moon Bay
501 Main Street
Half Moon Bay, CA 94019
Dear Mayor Penrose,
I am writing to propose an innovative and unique initiative that would not only enhance the beauty of our picturesque harbor but also provide a safe haven for one of our beloved coastal residents: the California Brown Pelican. I am excited to advocate for the installation of cozy boxe

你可能感兴趣的:(人工智能,自然语言处理,大模型,程序人生,LLM,gpt,ai)