Use your NVIDIA GPU's VRAM as swap space on Linux. Built for laptops with soldered memory and no upgrade path. If you have an RTX card sitting there with 8GB of VRAM and you're getting swapped to SSD, this puts that VRAM to work.
Port of MiniGPT4 in C++ (4bit, 5bit, 6bit, 8bit, 16bit CPU inference with GGML).
Key parameters and specifications
Key parameters and specifications
Parameter
Value
Language
Python
Category
Infrastructure
Subcategory
Inference service optimization
Keywords
LocalAI
Stars
576
Forks
42
Contributors
2
Created date
2023-03-08
Updated date
2026-09-21
Stars in 1 day
0
Stars in 7 days
0
Rank
16,714
Previous rank
16,503
Rank change
-211
7-day stars rank
15,681
Previous 7-day stars rank
15,688
7-day stars rank change
7
Total stars rank
17,331
Previous total stars rank
17,302
Total stars rank change
-29
Country
Switzerland
README summary
LLaMA_MPS Run LLaMA (and Stanford-Alpaca) inference on Apple Silicon GPUs. As you can see, unlike other LLMs, LLaMA is not biased in any way 😄 Initial setup steps **1. Install Python dependencies** LLaMA-specific setup **3. Download the model weights and put them into a folder called** (e. _(Optional)_ Reshard the model weights (13B/30B/65B)** Since we are running the inference on a single GPU, we need to merge the larger models' weights into a single file. Run
the inference** The above steps will let you run inference on the raw LLaMA model in an 'auto-complete' mode. If you would like to try the 'instruction-response' mode similar to ChatGPT using the fine-tuned weights of Stanford Alpaca, continue the setup with the following steps: Alpaca-specific setup **3. Download the fine-tuned weights (available for 7B/13B)** **4. GB | **Min specs per model (slow due to swapping):** 7B - 16 GB RAM 13B - 32 GB RAM 30B
- 64 GB RAM 65B - needs testing **Recommended specs per model:** 7B - 24 GB RAM 13B - 48 GB RAM 30B - 96 GB RAM 65B - needs testing Parameters to experiment with **- max_batch_size** If you have spare memory (e. , when running the 13B model on a 64 GB Mac), you can increase the batch size by using the argument. **- max_seq_len** To increase/decrease the maximum length of generated text, use the argument. **- use_repetition_penalty** The example script penalizes
the model for generating a repetitive content. This should lead to higher quality output, but it slightly slows down the inference. Run the script with argument to disable the penalty algorithm. Alternatives The best alternative to LLaMA_MPS for Apple Silicon users is llama. cpp, which is a C/C++ re-implementation that runs the inference purely on the CPU part of the SoC. Because compiled C code is so much faster than Python, it can actually beat this MPS
implementation in speed, however at the cost of much worse power and heat efficiency. See the below comparison when deciding which implementation better fits your use case. 16 | Credits facebookresearch (original code) markasoftware (cpu optimizations) remixer-dec (mps optimizations) venuatu (continuous token printing / loading optimizations) benob (reshard script) tloen (repetition penalty / LoRA merge script)
Frequently asked questions
How many stars and forks are recorded?
jankais3r/LLaMA_MPS has 576 stars and 42 forks.
What is the repository rank?
jankais3r/LLaMA_MPS is ranked 16,714.
What language and category are recorded?
jankais3r/LLaMA_MPS has 576 stars, uses Python and belongs to Infrastructure.
Which repository is closest in rank?
jankais3r/LLaMA_MPS is compared with NVIDIA/jitify, ranked 16,723 with 575 stars.
README
LLaMA_MPS
Run LLaMA (and Stanford-Alpaca) inference on Apple Silicon GPUs.
As you can see, unlike other LLMs, LLaMA is not biased in any way 😄
The above steps will let you run inference on the raw LLaMA model in an 'auto-complete' mode.
If you would like to try the 'instruction-response' mode similar to ChatGPT using the fine-tuned weights of Stanford Alpaca, continue the setup with the following steps:
Alpaca-specific setup
3. Download the fine-tuned weights (available for 7B/13B)
If you have spare memory (e.g., when running the 13B model on a 64 GB Mac), you can increase the batch size by using the --max_batch_size=32 argument. Default value is 1.
- max_seq_len
To increase/decrease the maximum length of generated text, use the --max_seq_len=256 argument. Default value is 512.
- use_repetition_penalty
The example script penalizes the model for generating a repetitive content. This should lead to higher quality output, but it slightly slows down the inference. Run the script with --use_repetition_penalty=False argument to disable the penalty algorithm.
Alternatives
The best alternative to LLaMA_MPS for Apple Silicon users is llama.cpp, which is a C/C++ re-implementation that runs the inference purely on the CPU part of the SoC. Because compiled C code is so much faster than Python, it can actually beat this MPS implementation in speed, however at the cost of much worse power and heat efficiency.
See the below comparison when deciding which implementation better fits your use case.