Instructions to use scholzmx/sepalith-2b-nes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scholzmx/sepalith-2b-nes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="scholzmx/sepalith-2b-nes")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("scholzmx/sepalith-2b-nes") model = AutoModelForCausalLM.from_pretrained("scholzmx/sepalith-2b-nes", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use scholzmx/sepalith-2b-nes 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 scholzmx/sepalith-2b-nes:Q4_K_M # Run inference directly in the terminal: llama cli -hf scholzmx/sepalith-2b-nes:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf scholzmx/sepalith-2b-nes:Q4_K_M # Run inference directly in the terminal: llama cli -hf scholzmx/sepalith-2b-nes:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf scholzmx/sepalith-2b-nes:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf scholzmx/sepalith-2b-nes:Q4_K_M
Use Docker
docker model run hf.co/scholzmx/sepalith-2b-nes:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use scholzmx/sepalith-2b-nes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "scholzmx/sepalith-2b-nes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scholzmx/sepalith-2b-nes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/scholzmx/sepalith-2b-nes:Q4_K_M
- SGLang
How to use scholzmx/sepalith-2b-nes 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 "scholzmx/sepalith-2b-nes" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scholzmx/sepalith-2b-nes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "scholzmx/sepalith-2b-nes" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scholzmx/sepalith-2b-nes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use scholzmx/sepalith-2b-nes with Ollama:
ollama run hf.co/scholzmx/sepalith-2b-nes:Q4_K_M
- Unsloth Desktop
- Pi
How to use scholzmx/sepalith-2b-nes with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf scholzmx/sepalith-2b-nes: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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "scholzmx/sepalith-2b-nes:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use scholzmx/sepalith-2b-nes with Docker Model Runner:
docker model run hf.co/scholzmx/sepalith-2b-nes:Q4_K_M
- Lemonade
How to use scholzmx/sepalith-2b-nes with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull scholzmx/sepalith-2b-nes:Q4_K_M
Run and chat with the model
lemonade run user.sepalith-2b-nes-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use scholzmx/sepalith-2b-nes with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf scholzmx/sepalith-2b-nes: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:9931/v1 hermes config set model.default scholzmx/sepalith-2b-nes:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use scholzmx/sepalith-2b-nes with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf scholzmx/sepalith-2b-nes: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:9931/v1 \ --custom-model-id "scholzmx/sepalith-2b-nes: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"
Sepalith 2B NES
A small, local-first next-edit-suggestion model for R. You give it the code around your cursor and it rewrites the current region, or says that no edit is needed. It was built for Sepalith and runs on a laptop CPU or iGPU through llama.cpp.
This is a hobby project. It is not a chat model and it does not follow instructions outside its prompt format.
Files
| File | Size | Use |
|---|---|---|
sepalith-2b-nes-Q6_K.gguf |
2.20 GB | Default. Passed the quant gate against bf16. |
sepalith-2b-nes-Q4_K_M-mixB.gguf |
1.66 GB | Small tier. See the no-op note below. |
model.safetensors + configs |
5.03 GB | bf16 weights for transformers. |
SHA256:
- Q6_K:
6593785330b99076b80ae3ac679bda76c5fcff1ebd1873f46f944c1ec43a3261 - Q4_K_M-mixB:
e24fbfbc5ea47c88647445ec682196fc67af9134d4fa36e826beeda045f1c71b - model.safetensors:
4a43ece2c6d86e77b929b0d6771fdb2e42e609e4b6665073851d761f1f5ac055
How it was trained
- Base: openbmb/MiniCPM5-2B-Midtrain.
- Continued pretraining on about 472M tokens of permissively licensed R code: scholzmx/sepalith-2b-cpt, step 11,586.
- Editing SFT on R edit examples built from CRAN packages (finish a block, rewrite to a pipe, rename, no-op, and others).
- Two rounds of GRPO with an execution reward: the model's edit is run against the function's tests in R. This release is checkpoint 100 of the second round.
Architecture: LlamaForCausalLM, 42 layers, hidden size 2048, vocabulary
130,560, about 2.5B parameters.
Use it in VS Code or Positron
The Sepalith extension runs a local llama-server and shows suggestions as
ghost text, or as a diff preview for rewrites. It renders the prompt below
byte for byte. It is not on the marketplace yet, so build it from the
repository:
git clone https://github.com/sims1253/Sepalith
cd Sepalith/extensions/vscode-sepalith
npm ci && npm run build
npx @vscode/vsce package --allow-missing-repository
code --install-extension vscode-sepalith-0.1.0.vsix # Positron: Extensions view, Install from VSIX
Then point it at a llama.cpp llama-server binary (absolute path):
{ "sepalith.serverPath": "/path/to/llama.cpp/build/bin/llama-server" }
On first start the extension downloads sepalith-2b-nes-Q6_K.gguf from this
repo and checks its size and SHA256. To use the small tier, download it and
set sepalith.modelPath to its absolute path.
llama.cpp b10453 (3cb7ffb1a) is the tested build. Open an R file and pause
typing, or press Alt+\ to ask for a suggestion. Tab accepts ghost text and
Alt+Enter applies a previewed rewrite.
The extension was tested end to end against the Q6_K file on CPU: on 8
sample contexts its prompt token IDs matched training exactly, and every
answer parsed. Zed is not supported: its built-in zeta2 prompt is a
different format.
Prompt format
Send raw text to a completion endpoint, not a chat endpoint (see Chat template below).
The prompt (renderer zeta2-prm03-v1) looks like this. <|user_cursor|>
marks the cursor inside the current region, and the prompt ends with a
newline after <[fim-middle]>:
Edit the current region. Output the complete replacement region, preserving whitespace. For no change, output the ordinary line [NO_EDIT] followed by the exact terminal line >>>>>>> UPDATED; an empty body is reserved for deletion of a nonempty range.
<filename>R/example.R
f <- function(x) {
<filename>selected_references
<filename>edit_history
<filename>diagnostics
<filename>retrieval
<[fim-suffix]>
value
}
<<<<<<< CURRENT
value <- sum(x)<|user_cursor|>
=======
<[fim-middle]>
The sections are:
- Header: the fixed instruction line, then
<filename>with the file path and the lines above the region. - Context slots:
selected_references,edit_history,diagnosticsandretrieval. They may be empty, but they must be present. Edit history uses the formUser edited "R/f.R":followed by a diff hunk. - Suffix: the lines below the region, after
<[fim-suffix]>. - Region: the lines to edit, between
<<<<<<< CURRENTand=======. An empty region is an insertion point.
The model answers with the full new region followed by >>>>>>> UPDATED,
or [NO_EDIT] and the same terminal line. An empty body means "delete the
region".
Tokenization rules (the markers are plain text, not special tokens):
- Encode the prompt without parsing special tokens and without adding BOS.
- Prepend exactly one BOS (id 0) yourself.
- Decode greedily with a 1,024-token cap, and stop on id 1 or 130073. Only a stop on id 1 counts as a finished answer.
The reference implementation is render_prompt, encode_prompt and
parse_output in
sepalith.campaign_protocol.
llama.cpp
llama-server -m sepalith-2b-nes-Q6_K.gguf -c 8192 --port 8080
# prompt.txt holds the rendered prompt, ending in "<[fim-middle]>\n"
IDS=$(jq -Rs '{content: ., add_special: false, parse_special: false}' prompt.txt \
| curl -s localhost:8080/tokenize -d @- | jq -c '[0] + .tokens')
jq -n --argjson ids "$IDS" \
'{prompt: $ids, n_predict: 1024, temperature: 0, top_k: 1, samplers: ["top_k"]}' \
| curl -s localhost:8080/completion -d @- | jq -r .content
Sending token IDs keeps the input exact. A plain string prompt gives the
same tokens for ordinary code, because the server adds the same single BOS.
But if your source contains special-token text such as <|im_start|>, the
server would then parse it as a control token.
transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("scholzmx/sepalith-2b-nes")
model = AutoModelForCausalLM.from_pretrained("scholzmx/sepalith-2b-nes", dtype=torch.bfloat16)
ids = torch.tensor([[0] + tok.encode(prompt, add_special_tokens=False, split_special_tokens=True)])
out = model.generate(ids, attention_mask=torch.ones_like(ids), max_new_tokens=1024,
do_sample=False, eos_token_id=[1, 130073])
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
Chat template
This model has no chat template of its own, and it was not trained on chat.
- GGUF files: they carry the base model's generic chat template in
tokenizer.chat_template(SHA256cc945752db555d60949b16989df4ccfeb52a313d6b4b5c5229dd786e2e9fcf1c), which llama.cpp's conversion step copies over. It adds role markers, an assistant prefix and tool-calling text. The model never saw these during editing SFT or GRPO. So/v1/chat/completions,llama-clichat mode, Ollama or LM Studio's chat view will give poor results. - transformers files: no template is included, so
apply_chat_templatefails on purpose.
Use a raw completion request as shown above.
Evaluation
Held-out panel (240 cases, built from CRAN packages never used in training or model selection, scored once):
| Model | Correct | Rate (95% CI) |
|---|---|---|
| Editing-SFT parent (before GRPO) | 100 / 240 | 41.7% [32.8, 50.6] |
| This model, bf16 | 98 / 240 | 40.8% [32.4, 49.4] |
| This model, Q6_K | 97 / 240 | 40.4% [31.9, 48.9] |
All three got 39 of 50 no-op cases right. The differences are not significant. GRPO did not improve edit accuracy on this panel.
Execution hold-out (3,803 function-completion tasks, 630 functions): all tests pass for 39.9% [38.1, 41.8] of tasks, against 39.2% for the previous checkpoint.
Quantization (250-case dev panel vs. bf16):
| Tier | Correct / 250 | Mean KLD | Note |
|---|---|---|---|
| bf16 | 112 | 0 | |
| Q6_K | 111 | 0.0037 | Passed all gate checks |
| Q4_K_M-mixB | 110 | 0.0236 | False no-ops rose from 10 to 15 (+2.0 pp), above the 1.0 pp gate |
The small tier says "no edit" a little more often when an edit was wanted. It was accepted anyway, because a missed suggestion costs less than a wrong one.
Latency (AMD Ryzen 5 PRO 5650U notebook, 8 threads, prompts of 131 to 4,227 tokens, p50):
| Tier | CPU first token | Vulkan iGPU first token |
|---|---|---|
| Q6_K | 7.1 s | 2.2 s |
| Q4_K_M-mixB | 5.3 s | 2.1 s |
Time to first token is mostly prompt prefill, so short prompts are much faster than these medians.
Limitations
- R only. Other languages were not trained or tested.
- About 41% of edits on the held-out panel are exactly right. Treat the output as a suggestion.
- Long rewrites (whole function bodies) are rarely correct.
- Editor support: VS Code and Positron through the extension above. Zed is not supported.
License
Apache-2.0, like the base model. The training data was restricted to R packages with permissive licenses; provenance is in the scholzmx/sepalith dataset.
- Downloads last month
- 205