minigpt4.cpp  by Maknee

C++ port for MiniGPT4 inference

created 2 years ago
568 stars

Top 57.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a C++ implementation for running MiniGPT-4, a multimodal large language model, with CPU inference capabilities using GGML. It targets developers and researchers seeking efficient, quantized execution of MiniGPT-4 on standard hardware without requiring GPUs.

How It Works

The core of minigpt4.cpp is its integration with the GGML library, enabling 4-bit, 5-bit, 6-bit, 8-bit, and 16-bit quantization of the MiniGPT-4 model. This approach significantly reduces memory footprint and computational requirements, allowing for inference on CPUs. The project facilitates model conversion from PyTorch to the GGML format, making pre-trained models accessible for local execution.

Quick Start & Requirements

  • Install: Clone the repository with git clone --recursive https://github.com/Maknee/minigpt4.cpp.
  • Build Library: Use CMake. For Linux: cmake . && cmake --build . --config Release. For Windows: cmake . && cmake --build . --config Release. Optional OpenCV support can be enabled via CMake.
  • Models: Download pre-quantized models from Hugging Face or convert PyTorch checkpoints using provided Python scripts. Vicuna models are also required.
  • Run: Execute inference via Python scripts (e.g., python minigpt4_library.py ...) or launch a web UI (python webui.py ...).
  • Dependencies: CMake, C++ compiler, Python 3.x, PyTorch (for conversion), and optionally OpenCV.

Highlighted Details

  • CPU-only inference for MiniGPT-4.
  • Supports 4-bit, 5-bit, 6-bit, 8-bit, and 16-bit quantization via GGML.
  • Includes scripts for converting PyTorch models to GGML format.
  • Offers a web UI for interactive use.

Maintenance & Community

Information on maintainers, community channels, or roadmaps is not detailed in the provided README.

Licensing & Compatibility

The README does not explicitly state the license for minigpt4.cpp. However, it relies on GGML and potentially other libraries, whose licenses would apply. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project appears to be a direct port, and performance characteristics compared to GPU-accelerated versions are not benchmarked. Obtaining and converting models requires familiarity with PyTorch and the original MiniGPT-4 repository setup.

Health Check
Last commit

2 years ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), Eugene Yan Eugene Yan(AI Scientist at AWS), and
2 more.

starcoder.cpp by bigcode-project

0.2%
456
C++ example for StarCoder inference
created 2 years ago
updated 1 year ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Tim J. Baek Tim J. Baek(Founder of Open WebUI), and
5 more.

gemma.cpp by google

0.1%
7k
C++ inference engine for Google's Gemma models
created 1 year ago
updated 1 day ago
Starred by Bojan Tunguz Bojan Tunguz(AI Scientist; Formerly at NVIDIA), Mckay Wrigley Mckay Wrigley(Founder of Takeoff AI), and
8 more.

ggml by ggml-org

0.3%
13k
Tensor library for machine learning
created 2 years ago
updated 3 days ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Nat Friedman Nat Friedman(Former CEO of GitHub), and
32 more.

llama.cpp by ggml-org

0.4%
84k
C/C++ library for local LLM inference
created 2 years ago
updated 14 hours ago
Feedback? Help us improve.