Meta 开源大模型,性能媲美 GPT-4。支持 8B/70B/405B 参数版本。
安装 Ollama: brew install ollama (Mac) 或下载 Windows 安装包下载模型: ollama pull llama3.1:8b (8B) / ollama pull llama3.1:70b (70B)运行模型: ollama run llama3.1:8bAPI模式: ollama serve 后访问 http://localhost:11434/v1/chat/completions兼容 OpenAI SDK,设置 base_url=http://localhost:11434/v1docker pull ollama/ollamadocker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamadocker exec -it ollama ollama pull llama3.1:8b使用 Nginx 反向代理 + Let's Encrypt HTTPS 证书配合 systemd 实现开机自启注册 groq.com,获取免费 API Keypip install groqfrom groq import Groq
client = Groq(api_key='...')
response = client.chat.completions.create(model='llama-3.1-8b-instant', messages=[{'role':'user','content':'Hello'}])免费额度充足,推理速度快于本地部署pip install vllmvllm serve meta-llama/Meta-Llama-3.1-8B-Instruct --host 0.0.0.0 --port 8000 --max-model-len 8192curl http://localhost:8000/v1/chat/completions -d '{"model":"meta-llama/Meta-Llama-3.1-8B-Instruct","messages":[...]}'PagedAttention + 连续批处理, 并发处理能力强