LocalAI  by mudler

Open-source OpenAI alternative for local AI inference

Created 2 years ago
35,349 stars

Top 0.9% on SourcePulse

GitHubView on GitHub
Project Summary

LocalAI provides a self-hosted, local-first, open-source alternative to OpenAI's API, enabling users to run various AI models (LLMs, image, audio) on consumer-grade hardware without requiring a GPU. It serves as a drop-in replacement REST API compatible with OpenAI's specifications, making advanced AI accessible for developers and researchers.

How It Works

LocalAI acts as a unified inference server, supporting multiple model architectures including GGUF, Transformers, and Diffusers. It leverages backends like llama.cpp, whisper.cpp, and stable-diffusion.cpp to efficiently run models locally. This approach allows for flexibility in model selection and deployment, offering a cost-effective and privacy-preserving solution for AI tasks.

Quick Start & Requirements

  • Installation:
    • Via script: curl https://localai.io/install.sh | sh
    • Via Docker (CPU): docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-cpu
    • Via Docker (Nvidia GPU): docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
  • Model Loading: Use local-ai run <model_identifier> (e.g., local-ai run llama-3.2-1b-instruct:q4_k_m, local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf).
  • Prerequisites: Docker, or a compatible OS for the installer script. GPU support requires NVIDIA drivers and CUDA 12+.
  • Documentation: https://localai.io/
  • Quickstart: https://localai.io/basics/getting_started/

Highlighted Details

  • Supports text generation, audio synthesis, speech-to-text, image generation, voice cloning, and P2P inferencing.
  • Features a built-in WebUI for model management and interaction.
  • Offers distributed and federated inference capabilities for scaling.
  • Integrates with popular tools like Langchain, Home Assistant, and various bots.

Maintenance & Community

  • Actively maintained by Ettore Di Giacinto and a community of contributors.
  • Recent updates include new backends, WebUI overhauls, and the addition of LocalAGI and LocalRecall to the stack.
  • Community support via Discord and GitHub Discussions.
  • Roadmap available: https://localai.io/roadmap/

Licensing & Compatibility

  • MIT License. Permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

  • Performance is dependent on consumer-grade hardware, which may limit throughput for demanding tasks compared to cloud-based solutions.
  • While GPU is not required, performance is significantly enhanced with NVIDIA GPUs.
Health Check
Last Commit

16 hours ago

Responsiveness

1 day

Pull Requests (30d)
178
Issues (30d)
102
Star History
707 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.