Instructions to use MaziyarPanahi/codegemma-2b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MaziyarPanahi/codegemma-2b-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaziyarPanahi/codegemma-2b-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MaziyarPanahi/codegemma-2b-GGUF", dtype="auto") - llama-cpp-python
How to use MaziyarPanahi/codegemma-2b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MaziyarPanahi/codegemma-2b-GGUF", filename="codegemma-2b.IQ3_XS.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MaziyarPanahi/codegemma-2b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MaziyarPanahi/codegemma-2b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaziyarPanahi/codegemma-2b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/codegemma-2b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
- SGLang
How to use MaziyarPanahi/codegemma-2b-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MaziyarPanahi/codegemma-2b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/codegemma-2b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MaziyarPanahi/codegemma-2b-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/codegemma-2b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use MaziyarPanahi/codegemma-2b-GGUF with Ollama:
ollama run hf.co/MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
- Unsloth Studio new
How to use MaziyarPanahi/codegemma-2b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for MaziyarPanahi/codegemma-2b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for MaziyarPanahi/codegemma-2b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MaziyarPanahi/codegemma-2b-GGUF to start chatting
- Docker Model Runner
How to use MaziyarPanahi/codegemma-2b-GGUF with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
- Lemonade
How to use MaziyarPanahi/codegemma-2b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MaziyarPanahi/codegemma-2b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.codegemma-2b-GGUF-Q4_K_M
List all available models
lemonade list
Upload folder using huggingface_hub
Upload folder using huggingface_hub
Multi commit ID: 5a56b165ac0787cc0f8328bb5d2e3e48959c4ab2467459babbe7bbb0fb03ab6b
Scheduled commits:
- Upload 2 file(s) totalling 1.2G (a6e356252194045728aadaea7b7ba3eab0ea2cfc71443943cdca2adfe1c148dd)
- Upload 1 file(s) totalling 1.5G (9a2b1684bd0149c4fe42e2c09aff5fc10b51e46e6e553232b74a3960f33a9dd2)
- Upload 1 file(s) totalling 1.2G (d4acd909edf58dd056aed6d374108a0601be66d979df0f4e3a6ad6751df2829c)
- Upload 1 file(s) totalling 1.5G (f3853ebf8a46aaafca677dd55bf971c523900838027f81fc874ef2fdb1bfcc46)
- Upload 1 file(s) totalling 1.4G (fc1895d758a53348af0833c316f9ca03d998e084d55c20fe2d96188144a97c00)
- Upload 1 file(s) totalling 1.3G (d7114bbe3a6e0a3c58cbb99ded60c9181491d7ce89ddb0d8aa0e41f63490a81b)
- Upload 1 file(s) totalling 1.6G (d58c15eb520c6f97d86c65ba5bb6fc17ebed5cfcb4f7e7fe5364051a50f94e44)
- Upload 1 file(s) totalling 1.6G (890350bf2305bfd1f31fbf86bd7cce0b356010cff747f9fa1828bab8adfb5945)
- Upload 1 file(s) totalling 1.8G (41f0eee54067602e60018d0a59951d5d9d3b97b91667e31af82b8794e07acba4)
- Upload 1 file(s) totalling 1.8G (a935a9582884752924b55860784aa5cea0b7b450317ccff812c35e0f8687c714)
- Upload 1 file(s) totalling 2.7G (0e5abd67ffd4397abb0781d8d0d2930693d2532d466d2a0150f081517dd7b136)
- Upload 1 file(s) totalling 5.0G (68699b7eab2f49728f5252f49d49404965b8d18df87c64185212de3f27dabb7d)
- Upload 1 file(s) totalling 2.1G (f1ffb699d02bf9a219c505e8ca2ac26278dc1790d140e6b951bcc8519e23633e)
This is a PR opened using the huggingface_hub library in the context of a multi-commit. PR can be commented as a usual PR. However, please be aware that manually updating the PR description, changing the PR status, or pushing new commits, is not recommended as it might corrupt the commit process. Learn more about multi-commits in this guide.
Multi-commit is now completed! You can ping the repo owner to review the changes. This PR can now be commented or modified without risking to corrupt it.
This is a comment posted using the huggingface_hub library in the context of a multi-commit. Learn more about multi-commits in this guide.
create_pr=False has been passed so PR is automatically merged.
This is a comment posted using the huggingface_hub library in the context of a multi-commit. Learn more about multi-commits in this guide.