Instructions to use nold/starcoder2-7b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nold/starcoder2-7b-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nold/starcoder2-7b-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nold/starcoder2-7b-GGUF", dtype="auto") - llama-cpp-python
How to use nold/starcoder2-7b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="nold/starcoder2-7b-GGUF", filename="starcoder2-7b_Q3_K_M.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 nold/starcoder2-7b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf nold/starcoder2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nold/starcoder2-7b-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 nold/starcoder2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nold/starcoder2-7b-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 nold/starcoder2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf nold/starcoder2-7b-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 nold/starcoder2-7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf nold/starcoder2-7b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/nold/starcoder2-7b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use nold/starcoder2-7b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nold/starcoder2-7b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nold/starcoder2-7b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nold/starcoder2-7b-GGUF:Q4_K_M
- SGLang
How to use nold/starcoder2-7b-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 "nold/starcoder2-7b-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": "nold/starcoder2-7b-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 "nold/starcoder2-7b-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": "nold/starcoder2-7b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use nold/starcoder2-7b-GGUF with Ollama:
ollama run hf.co/nold/starcoder2-7b-GGUF:Q4_K_M
- Unsloth Studio new
How to use nold/starcoder2-7b-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 nold/starcoder2-7b-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 nold/starcoder2-7b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for nold/starcoder2-7b-GGUF to start chatting
- Docker Model Runner
How to use nold/starcoder2-7b-GGUF with Docker Model Runner:
docker model run hf.co/nold/starcoder2-7b-GGUF:Q4_K_M
- Lemonade
How to use nold/starcoder2-7b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nold/starcoder2-7b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.starcoder2-7b-GGUF-Q4_K_M
List all available models
lemonade list
Upload folder using huggingface_hub
Upload folder using huggingface_hub
Multi commit ID: 134190755d44dca35c06d0c139e699efa2debeac0790c70e3ad922b885399341
Scheduled commits:
- Upload 1 file(s) totalling 3.6G (a0e4a17a2fea1fb2828a41a137d1de06c2edb18ebe6eeeae6e889f4bbad5b75e)
- Upload 1 file(s) totalling 4.4G (d5245590b23d53d9ceccbecd102c44dedf3f88989698223f6fa428f01e18a86b)
- Upload 1 file(s) totalling 5.1G (5dea59c9118e1e143ab3933f98e10dd3838bf71164c52a60ffa57f1830174af2)
- Upload 1 file(s) totalling 5.9G (d6b0dbc3250b197609b76c70c7739fde4e20b9279fd29e06316f8fbacbd7d915)
- Upload 1 file(s) totalling 7.6G (2923157105bf0aafacc2904fa7e64cee433909244228acfd7dd1a24089f923d5)
- Upload 1 file(s) totalling 8.7K (bc083203804bd24c749609de9d63349f87122e2b64ee0ceadc50b647484dfd3c)
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.