The inference engine for PygmalionAI models
Project description
Breathing Life into Language
Aphrodite is the official backend engine for PygmalionAI. It is designed to serve as the inference endpoint for the PygmalionAI website, and to allow serving Hugging Face-compatible models to a large number of users with blazing fast speeds (thanks to vLLM's Paged Attention).
Aphrodite builds upon and integrates the exceptional work from various projects.
The compute necessary for Aphrodite's development is provided by Arc Compute.
🔥 News
(09/2024) v0.6.1 is here. You can now load FP16 models in FP2 to FP7 quant formats, to achieve extremely high throughput and save on memory.
(09/2024) v0.6.0 is released, with huge throughput improvements, many new quant formats (including fp8 and llm-compressor), asymmetric tensor parallel, pipeline parallel and more! Please check out the exhaustive documentation for the User and Developer guides.
Features
- Continuous Batching
- Efficient K/V management with PagedAttention from vLLM
- Optimized CUDA kernels for improved inference
- Quantization support via AQLM, AWQ, Bitsandbytes, GGUF, GPTQ, QuIP#, Smoothquant+, SqueezeLLM, Marlin, FP2-FP12
- Distributed inference
- 8-bit KV Cache for higher context lengths and throughput, at both FP8 E5M3 and E4M3 formats.
Quickstart
Install the engine:
pip install -U aphrodite-engine
Then launch a model:
aphrodite run meta-llama/Meta-Llama-3.1-8B-Instruct
This will create a OpenAI-compatible API server that can be accessed at port 2242 of the localhost. You can plug in the API into a UI that supports OpenAI, such as SillyTavern.
Please refer to the documentation for the full list of arguments and flags you can pass to the engine.
You can play around with the engine in the demo here:
Docker
Additionally, we provide a Docker image for easy deployment. Here's a basic command to get you started:
docker run --runtime nvidia --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
#--env "CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7" \
-p 2242:2242 \
--ipc=host \
alpindale/aphrodite-openai:latest \
--model NousResearch/Meta-Llama-3.1-8B-Instruct \
--tensor-parallel-size 8 \
--api-keys "sk-empty"
This will pull the Aphrodite Engine image (~8GiB download), and launch the engine with the Llama-3.1-8B-Instruct model at port 2242.
Requirements
- Operating System: Linux (or WSL for Windows)
- Python: 3.8 to 3.12
For windows users, it's recommended to use tabbyAPI instead, if you do not need batching support.
Build Requirements:
- CUDA >= 11
For supported devices, see here. Generally speaking, all semi-modern GPUs are supported - down to Pascal (GTX 10xx, P40, etc.) We also support AMD GPUs, Intel CPUs and GPUs, Google TPU, and AWS Inferentia.
Notes
-
By design, Aphrodite takes up 90% of your GPU's VRAM. If you're not serving an LLM at scale, you may want to limit the amount of memory it takes up. You can do this in the API example by launching the server with the
--gpu-memory-utilization 0.6
(0.6 means 60%). -
You can view the full list of commands by running
aphrodite run --help
.
Acknowledgements
Aphrodite Engine would have not been possible without the phenomenal work of other open-source projects. Credits go to:
- vLLM (CacheFlow)
- TensorRT-LLM
- xFormers
- Flash Attention
- llama.cpp
- AutoAWQ
- AutoGPTQ
- SqueezeLLM
- Exllamav2
- TabbyAPI
- AQLM
- KoboldAI
- Text Generation WebUI
- Megatron-LM
- Ray
Contributing
Everyone is welcome to contribute. You can support the project by opening Pull Requests for new features, fixes, or general UX improvements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file aphrodite_engine-0.6.3-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: aphrodite_engine-0.6.3-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 211.8 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16abf468c7802acd3b5ed0de238c12f6866fc3f10117417c46e1b4bdf6516451 |
|
MD5 | 43aa5b4680f08bad4210ebca1d982f37 |
|
BLAKE2b-256 | 618aaf032580007a24d94c4b13e39721dac936aa21f6d6e0bdc4d041c394b638 |
File details
Details for the file aphrodite_engine-0.6.3-cp38-abi3-manylinux1_x86_64.whl
.
File metadata
- Download URL: aphrodite_engine-0.6.3-cp38-abi3-manylinux1_x86_64.whl
- Upload date:
- Size: 196.2 MB
- Tags: CPython 3.8+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0a2bf474bba16a4a6d9764b7811e8cf2b882cfb60d97fcfaf3a4ec7d6e758b2 |
|
MD5 | f92e35495edc645df14567e8eff8bdb5 |
|
BLAKE2b-256 | 606aa83eb00dd23a90cca5a9afb82ffe190e80728fcd476b10f1200cd8974d13 |