27.6K Stars!【推荐】告别GPU压力:轻松本地运行AI模型的终极指南

1、介绍

项目地址:

https://github.com/mudler/LocalAI

LocalAI 是免费的开源 OpenAI 替代品。LocalAI 充当与 OpenAI 兼容的直接替代 REST API(Elevenlabs、Anthropic…本地 AI 推理的 API 规范。它允许您在本地或本地使用消费级硬件运行 LLM、生成图像、音频(不仅如此),支持多个型号系列。不需要 GPU。它由 Ettore Di Giacinto 创建和维护。

2、部署

运行安装程序脚本:

curl https://localai.io/install.sh | sh

或使用 docker 运行:

# CPU only image:
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-cpu

# Nvidia GPU:
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12

# CPU and GPU image (bigger size):
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest

# AIO images (it will pre-download a set of models ready for use, see https://localai.io/basics/container/)
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-cpu

要加载模型:

# From the model gallery (see available models with `local-ai models list`, in the WebUI from the model tab, or visiting https://models.localai.io)
local-ai run llama-3.2-1b-instruct:q4_k_m
# Start LocalAI with the phi-2 model directly from huggingface
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
# Install and run a model from the Ollama OCI registry
local-ai run ollama://gemma:2b
# Run a model from a configuration file
local-ai run https://gist.githubusercontent.com/.../phi-2.yaml
# Install and run a model from a standard OCI registry (e.g., Docker Hub)
local-ai run oci://localai/phi-2:latest

3、使用

参考官方的文档:

https://localai.io/

4、Star 历史

六、结语

Ollama 和 LocalAI 各具特色,分别面向不同需求和用户群体。本地化大语言模型的普及,标志着 AI 应用朝着更高效、更隐私、更经济的方向发展。选择适合自己的工具,将有助于你在 AI 时代脱颖而出。

欢迎留言讨论:你更倾向于 Ollama 还是 LocalAI?或者有其他本地模型推荐?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI云极

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值