Instructions to use second-state/StarCoder2-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use second-state/StarCoder2-7B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="second-state/StarCoder2-7B-GGUF")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("second-state/StarCoder2-7B-GGUF") model = AutoModelForCausalLM.from_pretrained("second-state/StarCoder2-7B-GGUF") - llama-cpp-python
How to use second-state/StarCoder2-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="second-state/StarCoder2-7B-GGUF", filename="starcoder2-7b-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-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 second-state/StarCoder2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/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 second-state/StarCoder2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/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 second-state/StarCoder2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/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 second-state/StarCoder2-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/StarCoder2-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/StarCoder2-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use second-state/StarCoder2-7B-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-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": "second-state/StarCoder2-7B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/second-state/StarCoder2-7B-GGUF:Q4_K_M
- SGLang
How to use second-state/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 "second-state/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": "second-state/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 "second-state/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": "second-state/StarCoder2-7B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use second-state/StarCoder2-7B-GGUF with Ollama:
ollama run hf.co/second-state/StarCoder2-7B-GGUF:Q4_K_M
- Unsloth Studio new
How to use second-state/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 second-state/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 second-state/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 second-state/StarCoder2-7B-GGUF to start chatting
- Docker Model Runner
How to use second-state/StarCoder2-7B-GGUF with Docker Model Runner:
docker model run hf.co/second-state/StarCoder2-7B-GGUF:Q4_K_M
- Lemonade
How to use second-state/StarCoder2-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/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
Xin Liu commited on
Commit ·
495c907
1
Parent(s): 6571268
Add models
Browse filesSigned-off-by: Xin Liu <sam@secondstate.io>
- .gitattributes +1 -0
- starcoder2-7b-Q2_K.gguf +3 -0
- starcoder2-7b-Q3_K_L.gguf +3 -0
- starcoder2-7b-Q3_K_M.gguf +3 -0
- starcoder2-7b-Q3_K_S.gguf +3 -0
- starcoder2-7b-Q4_0.gguf +3 -0
- starcoder2-7b-Q4_K_M.gguf +3 -0
- starcoder2-7b-Q4_K_S.gguf +3 -0
- starcoder2-7b-Q5_0.gguf +3 -0
- starcoder2-7b-Q5_K_M.gguf +3 -0
- starcoder2-7b-Q5_K_S.gguf +3 -0
- starcoder2-7b-Q6_K.gguf +3 -0
- starcoder2-7b-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-7b-Q2_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f067909d93620ce61834426f7a31416a07cf8b5ebc39f19a4fd1e10bff09392e
|
| 3 |
+
size 2724543296
|
starcoder2-7b-Q3_K_L.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b7e3c8c09b64f447ec27973a1c77fa03be5ae7661286347e071bcc7f7755ba4
|
| 3 |
+
size 3985587008
|
starcoder2-7b-Q3_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad1b55bff88200c0e6541eca5a5c8dc3b9cc9cadee7a33628acaf4549aac5bae
|
| 3 |
+
size 3594533696
|
starcoder2-7b-Q3_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01905a299e979234f7d39ec8e15b5f2aad9d1afa99983ad10b9415e487ec2272
|
| 3 |
+
size 3090234176
|
starcoder2-7b-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:afc57cb47969f8ff40484a87f4a64bcac76ddb73ca1112dedaf201abe607ec05
|
| 3 |
+
size 4042799936
|
starcoder2-7b-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6d6e50fa0c240bb5ea13bae6c06e7d3dbb689b0edc55b3610c867c44d9baa7b
|
| 3 |
+
size 4402887488
|
starcoder2-7b-Q4_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:beb8724aa4a6d8ab100819001f4fe192967b7461ab5a14161e5cc5a770935a9f
|
| 3 |
+
size 4128914240
|
starcoder2-7b-Q5_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e5d12f32630a2a2e872e026d3361daee2efb540b9bae79144fd38e4c19ad7f7
|
| 3 |
+
size 4939332416
|
starcoder2-7b-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d385b900e824be5d24b7fda98b898c2bcac07e008f3cb8ac49a0d0883ae3a747
|
| 3 |
+
size 5124832064
|
starcoder2-7b-Q5_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d8bb772877092498ac7f56d5dd3459659e8f600dafc5255d99144f6ad6d1b2c
|
| 3 |
+
size 4939332416
|
starcoder2-7b-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73836e765b166d41038c1535174425c1be288310d9ad27fd8180f0f94b846e44
|
| 3 |
+
size 5891898176
|
starcoder2-7b-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48b4842e14dc891e2abd7165ad36297cb45b702db0f98325f83fb0a94fd68dd8
|
| 3 |
+
size 7628929856
|