Text Generation
Transformers
GGUF
Safetensors
mistral
quantized
2-bit
3-bit
4-bit precision
5-bit
6-bit
8-bit precision
GGUF
gemma
has_space
text-generation-inference
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")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MaziyarPanahi/codegemma-2b-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MaziyarPanahi/codegemma-2b-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -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 serve -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 Desktop
- 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
- Atomic Chat
Commit History
-
Upload folder using huggingface_hub
Verified signaturef4df149 -
Upload folder using huggingface_hub (#1)
Verified signature- a6e356252194045728aadaea7b7ba3eab0ea2cfc71443943cdca2adfe1c148dd (2e25e7ed726092152e5956079b9054a4687a9b89) - 9a2b1684bd0149c4fe42e2c09aff5fc10b51e46e6e553232b74a3960f33a9dd2 (d70a7a7b016e6704d512aac4c48fb7f348228cab) - d4acd909edf58dd056aed6d374108a0601be66d979df0f4e3a6ad6751df2829c (3f329ad5416c4aca0b5e88455ff89551bfad4ed0) - f3853ebf8a46aaafca677dd55bf971c523900838027f81fc874ef2fdb1bfcc46 (db749bd9a797c7a8981d0459e91ea09653bed61b) - fc1895d758a53348af0833c316f9ca03d998e084d55c20fe2d96188144a97c00 (89508ca6a7de3391598c0f247dd542ae9757342c) - d7114bbe3a6e0a3c58cbb99ded60c9181491d7ce89ddb0d8aa0e41f63490a81b (9e4c072af83ca7c14c5a101a3065ef86d88c824f) - d58c15eb520c6f97d86c65ba5bb6fc17ebed5cfcb4f7e7fe5364051a50f94e44 (39b92d9cfcfc34f9ed29447896945225b977ff7a) - 890350bf2305bfd1f31fbf86bd7cce0b356010cff747f9fa1828bab8adfb5945 (929837a71530c58b20eea05c19f48b4c8ea174b5) - 41f0eee54067602e60018d0a59951d5d9d3b97b91667e31af82b8794e07acba4 (bfd03f81206fe274c1db24db973007617a341b71) - a935a958…7c9ad81 -
initial commit
Verified signature1b4f1b3