feat: add GGUF/GGML model support via llama-cpp-python#3826
Closed
crawfordxx wants to merge 1 commit intolm-sys:mainfrom
Closed
feat: add GGUF/GGML model support via llama-cpp-python#3826crawfordxx wants to merge 1 commit intolm-sys:mainfrom
crawfordxx wants to merge 1 commit intolm-sys:mainfrom
Conversation
Add a new model worker backend that uses llama-cpp-python to load and serve quantized GGUF/GGML models. This enables running large language models efficiently on CPU or with partial GPU offloading. - Add gguf_worker.py following the same pattern as mlx_worker/vllm_worker - Support streaming and non-streaming text generation - Support configurable GPU offloading (n_gpu_layers), context size, batch size - Add llama-cpp-python as an optional dependency in pyproject.toml - Add integration documentation in docs/gguf_integration.md Closes lm-sys#2410
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new model worker backend (
gguf_worker.py) that uses llama-cpp-python to load and serve quantized GGUF/GGML models through FastChat.fastchat/serve/gguf_worker.py— follows the same worker interface pattern asmlx_worker.pyandvllm_worker.pyllama-cpp-python>=0.2.0added topyproject.tomlunder[gguf]extradocs/gguf_integration.mdwith setup and usage instructionsFeatures
--n-gpu-layers)--n-ctx) and batch size (--n-batch)Usage
pip install "llama-cpp-python>=0.2.0" python3 -m fastchat.serve.gguf_worker \ --model-path ./models/llama-2-7b-chat.Q4_K_M.gguf \ --model-names llama-2-7b-chat \ --conv-template llama-2 \ --n-gpu-layers -1Closes #2410