LocalAI: OpenAI、Claude 等的开源替代

GitHubhttps://github.com/mudler/LocalAI

更多AI开源软件发现分享好用的AI工具、AI开源软件、AI模型、AI变现 - 小众AI

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

主要功能

1. 模型兼容性

LocalAI支持多种主流的模型架构:

  • GGUF格式模型
  • Transformers模型
  • Diffusers模型
  • 其他开源AI模型
全面的AI能力
  • 文本生成:支持各类GPT模型,可进行对话、写作等任务
  • 文本转语音:将文字转换为自然的语音输出
  • 语音转文本:基于whisper.cpp实现高质量语音识别
  • 图像生成:支持Stable Diffusion等AI绘画模型
  • OpenAI兼容API:提供与OpenAI API完全兼容的接口
  • 向量嵌入:支持文本向量化,可用于向量数据库
  • 视觉识别:支持图像识别和理解
  • 重排序API:优化搜索结果排序
  • 语音活动检测:集成Silero-VAD
  • 内置WebUI界面:提供友好的可视化操作界面

💻 安装和使用

运行安装程序脚本:

# Basic installation
curl https://localai.io/install.sh | sh

有关更多安装选项,请参阅安装程序选项

或使用 docker 运行:

仅 CPU 镜像:
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
NVIDIA GPU 镜像:
# CUDA 12.0
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12

# CUDA 11.7
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-11

# NVIDIA Jetson (L4T) ARM64
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64
AMD GPU 镜像 (ROCm):
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-gpu-hipblas
Intel GPU 镜像 (oneAPI):
# Intel GPU with FP16 support
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-intel-f16

# Intel GPU with FP32 support
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-intel-f32
Vulkan GPU 镜像:
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-vulkan
AIO 镜像(预下载型号):
# CPU version
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-cpu

# NVIDIA CUDA 12 version
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-12

# NVIDIA CUDA 11 version
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-11

# Intel GPU version
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel-f16

# AMD GPU version
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-aio-gpu-hipblas

关于 AIO 镜像和预下载模型的更多信息,请参见 容器文档

要加载模型:

# 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值