Instructions to use second-state/StarCoder2-3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use second-state/StarCoder2-3B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="second-state/StarCoder2-3B-GGUF")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("second-state/StarCoder2-3B-GGUF") model = AutoModelForCausalLM.from_pretrained("second-state/StarCoder2-3B-GGUF") - llama-cpp-python
How to use second-state/StarCoder2-3B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="second-state/StarCoder2-3B-GGUF", filename="starcoder2-3b-Q2_K.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 second-state/StarCoder2-3B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/StarCoder2-3B-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 second-state/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/StarCoder2-3B-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 second-state/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/StarCoder2-3B-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 second-state/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/StarCoder2-3B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/StarCoder2-3B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use second-state/StarCoder2-3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "second-state/StarCoder2-3B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "second-state/StarCoder2-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/second-state/StarCoder2-3B-GGUF:Q4_K_M
- SGLang
How to use second-state/StarCoder2-3B-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 "second-state/StarCoder2-3B-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": "second-state/StarCoder2-3B-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 "second-state/StarCoder2-3B-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": "second-state/StarCoder2-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use second-state/StarCoder2-3B-GGUF with Ollama:
ollama run hf.co/second-state/StarCoder2-3B-GGUF:Q4_K_M
- Unsloth Studio new
How to use second-state/StarCoder2-3B-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 second-state/StarCoder2-3B-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 second-state/StarCoder2-3B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for second-state/StarCoder2-3B-GGUF to start chatting
- Docker Model Runner
How to use second-state/StarCoder2-3B-GGUF with Docker Model Runner:
docker model run hf.co/second-state/StarCoder2-3B-GGUF:Q4_K_M
- Lemonade
How to use second-state/StarCoder2-3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/StarCoder2-3B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.StarCoder2-3B-GGUF-Q4_K_M
List all available models
lemonade list
Xin Liu commited on
Commit ·
c3f1976
1
Parent(s): dbd36fe
Add models
Browse filesSigned-off-by: Xin Liu <sam@secondstate.io>
- .gitattributes +1 -0
- starcoder2-3b-Q2_K.gguf +3 -0
- starcoder2-3b-Q3_K_L.gguf +3 -0
- starcoder2-3b-Q3_K_M.gguf +3 -0
- starcoder2-3b-Q3_K_S.gguf +3 -0
- starcoder2-3b-Q4_0.gguf +3 -0
- starcoder2-3b-Q4_K_M.gguf +3 -0
- starcoder2-3b-Q4_K_S.gguf +3 -0
- starcoder2-3b-Q5_0.gguf +3 -0
- starcoder2-3b-Q5_K_M.gguf +3 -0
- starcoder2-3b-Q5_K_S.gguf +3 -0
- starcoder2-3b-Q6_K.gguf +3 -0
- starcoder2-3b-Q8_0.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.gguf filter=lfs diff=lfs merge=lfs -text
|
starcoder2-3b-Q2_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d913d393f6af594bcae25cdc43b3962c59223adb364561143cf7931b9ce1b5a3
|
| 3 |
+
size 1149187136
|
starcoder2-3b-Q3_K_L.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e55a7877f5556a87c989bfc14355b9b3443a740afdafa192529d575fd16df26
|
| 3 |
+
size 1678591040
|
starcoder2-3b-Q3_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:150150764ef7a1a2f95815f5564525d7719445048c833acbc47ce6095d1cc51a
|
| 3 |
+
size 1513047104
|
starcoder2-3b-Q3_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87f8d3932ad25feca48799704e3a41e75da56f690655646dcf3c318a272c0de9
|
| 3 |
+
size 1307554880
|
starcoder2-3b-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8197026ab1cc481e6788a88ebe8ba7b5568141b7d576436aae3d86dd09586971
|
| 3 |
+
size 1709888576
|
starcoder2-3b-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8fb39287a463549b80d97473b0a7595c3a5a6da3ae2604ca33906a1a43f7175
|
| 3 |
+
size 1848976448
|
starcoder2-3b-Q4_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4db2dd5f10e16acce70273913eff1e8626208c37e967813fca67b79cb55b76b
|
| 3 |
+
size 1743311936
|
starcoder2-3b-Q5_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18d282b8a1fde791a71ce0f292c981ed1ed986ba7da48363541b03c518a328d3
|
| 3 |
+
size 2088555584
|
starcoder2-3b-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dcd804dc5888e4eb266ba9f6a03ddd7387dd41afbaae8dd14658660d26b6d6d4
|
| 3 |
+
size 2160206912
|
starcoder2-3b-Q5_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:484dc0d80a228f5de53f23431da52619372654c0d9cb11a9d2c8872fd56100c0
|
| 3 |
+
size 2088555584
|
starcoder2-3b-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:542dad6925fc4041a63fe039d6dc42582412877dd6b703da19be6e94327f69bb
|
| 3 |
+
size 2490889280
|
starcoder2-3b-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4cbf961fa378b1a9f86d5930d3fcb0c31bacfd3ad64fcd27aca680b10059ff8
|
| 3 |
+
size 3224556608
|