Text Generation
GGUF
English
supermongo
astronomy
code-generation
scientific-plotting
conversational
Instructions to use xpol555/sm-coder-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use xpol555/sm-coder-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 xpol555/sm-coder-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf xpol555/sm-coder-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 xpol555/sm-coder-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf xpol555/sm-coder-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 xpol555/sm-coder-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf xpol555/sm-coder-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 xpol555/sm-coder-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf xpol555/sm-coder-gguf:Q4_K_M
Use Docker
docker model run hf.co/xpol555/sm-coder-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use xpol555/sm-coder-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xpol555/sm-coder-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xpol555/sm-coder-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xpol555/sm-coder-gguf:Q4_K_M
- Ollama
How to use xpol555/sm-coder-gguf with Ollama:
ollama run hf.co/xpol555/sm-coder-gguf:Q4_K_M
- Unsloth Studio
How to use xpol555/sm-coder-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 xpol555/sm-coder-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 xpol555/sm-coder-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for xpol555/sm-coder-gguf to start chatting
- Pi
How to use xpol555/sm-coder-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf xpol555/sm-coder-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "xpol555/sm-coder-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use xpol555/sm-coder-gguf with Docker Model Runner:
docker model run hf.co/xpol555/sm-coder-gguf:Q4_K_M
- Lemonade
How to use xpol555/sm-coder-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull xpol555/sm-coder-gguf:Q4_K_M
Run and chat with the model
lemonade run user.sm-coder-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use xpol555/sm-coder-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf xpol555/sm-coder-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default xpol555/sm-coder-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use xpol555/sm-coder-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf xpol555/sm-coder-gguf:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "xpol555/sm-coder-gguf:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload model README
Browse files
README.md
CHANGED
|
@@ -1,3 +1,128 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## sm_llm Workflow
|
| 2 |
+
|
| 3 |
+
This folder contains the end-to-end pipeline to fine-tune `Qwen/Qwen2.5-Coder-1.5B-Instruct`
|
| 4 |
+
on SuperMongo examples and export a quantized GGUF model for Ollama.
|
| 5 |
+
|
| 6 |
+
### Files
|
| 7 |
+
|
| 8 |
+
- `1_dataset.jsonl`: ChatML training set
|
| 9 |
+
- `1b_alignment.jsonl`: targeted alignment examples (identity + anti-pseudo-syntax)
|
| 10 |
+
- `2_finetune_unsloth.py`: LoRA fine-tuning (Unsloth)
|
| 11 |
+
- `3_merge_weights.py`: merge LoRA into full model
|
| 12 |
+
- `4_convert_gguf.py`: HF -> GGUF + Q4_K_M quantization
|
| 13 |
+
- `5_build_mlc.py`: build MLC/WebLLM artifacts from merged model
|
| 14 |
+
- `6_publish_hf.py`: publish GGUF and/or MLC artifacts to Hugging Face
|
| 15 |
+
- `Modelfile.finetuned`: Ollama model definition
|
| 16 |
+
|
| 17 |
+
### Prerequisites (WSL + NVIDIA)
|
| 18 |
+
|
| 19 |
+
Run training from Linux/WSL with CUDA available.
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
nvidia-smi
|
| 23 |
+
python3 -c "import torch; print(torch.cuda.is_available())"
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
### Environment Setup
|
| 27 |
+
|
| 28 |
+
From `sm_llm/`:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
uv sync --extra train
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
If you are using an already active venv, use `--active` in `uv run`.
|
| 35 |
+
|
| 36 |
+
### Build llama.cpp (submodule)
|
| 37 |
+
|
| 38 |
+
The conversion script expects `llama.cpp` at `./llama.cpp` (submodule path).
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
cd llama.cpp
|
| 42 |
+
cmake -B build
|
| 43 |
+
cmake --build build -j
|
| 44 |
+
cd ..
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
### Train + Export
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
uv run --active --extra train python 2_finetune_unsloth.py
|
| 51 |
+
uv run --active --extra train python 3_merge_weights.py
|
| 52 |
+
uv run --active --extra train python 4_convert_gguf.py
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Generated artifacts:
|
| 56 |
+
|
| 57 |
+
- `lora_model/`
|
| 58 |
+
- `merged_model/`
|
| 59 |
+
- `gguf/sm-coder-1.5b-q4_k_m.gguf`
|
| 60 |
+
|
| 61 |
+
Note: `2_finetune_unsloth.py` loads both `1_dataset.jsonl` and `1b_alignment.jsonl` if present.
|
| 62 |
+
|
| 63 |
+
### Ollama Test
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
ollama create sm-coder -f Modelfile.finetuned
|
| 67 |
+
ollama run sm-coder
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
### Build MLC (WebLLM)
|
| 71 |
+
|
| 72 |
+
Install MLC CLI (inside WSL, in your active env).
|
| 73 |
+
The packages are hosted on a custom index and require platform-specific names.
|
| 74 |
+
For CUDA 13.0 (RTX 4080 / sm89):
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
uv pip install --pre -U --find-links https://mlc.ai/wheels mlc-llm-nightly-cu130 mlc-ai-nightly-cu130
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
> Note: `uv`-created venvs do not include `pip` by default, so use `uv pip` instead of `python -m pip`.
|
| 81 |
+
> For other CUDA versions replace `cu130` with e.g. `cu128` or `cpu`.
|
| 82 |
+
|
| 83 |
+
Build MLC artifacts from `merged_model/`:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
uv run --active python 5_build_mlc.py --model-id your-user/sm-coder-1.5b
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
Output is written to:
|
| 90 |
+
|
| 91 |
+
- `mlc_dist/weights`
|
| 92 |
+
- `mlc_dist/lib/*.wasm`
|
| 93 |
+
|
| 94 |
+
### Publish on Hugging Face
|
| 95 |
+
|
| 96 |
+
Install publish dependencies:
|
| 97 |
+
|
| 98 |
+
```bash
|
| 99 |
+
uv sync --extra publish
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Login once:
|
| 103 |
+
|
| 104 |
+
```bash
|
| 105 |
+
huggingface-cli login
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Publish only GGUF (the model used by Ollama):
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
uv run --active --extra publish python 6_publish_hf.py \
|
| 112 |
+
--gguf-repo your-user/sm-coder-gguf
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
Publish both GGUF and MLC artifacts:
|
| 116 |
+
|
| 117 |
+
```bash
|
| 118 |
+
uv run --active --extra publish python 6_publish_hf.py \
|
| 119 |
+
--gguf-repo your-user/sm-coder-gguf \
|
| 120 |
+
--mlc-repo your-user/sm-coder-mlc
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
Use `--private` if you want private repositories.
|
| 124 |
+
|
| 125 |
+
### Notes
|
| 126 |
+
|
| 127 |
+
- On `/mnt/c` you may see UV hardlink warnings; they are harmless.
|
| 128 |
+
- You can silence them with: `export UV_LINK_MODE=copy`
|