Instructions to use KellHect/Borealis-Code-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KellHect/Borealis-Code-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KellHect/Borealis-Code-1.0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KellHect/Borealis-Code-1.0") model = AutoModelForCausalLM.from_pretrained("KellHect/Borealis-Code-1.0", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use KellHect/Borealis-Code-1.0 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 KellHect/Borealis-Code-1.0:Q4_K_M # Run inference directly in the terminal: llama cli -hf KellHect/Borealis-Code-1.0:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KellHect/Borealis-Code-1.0:Q4_K_M # Run inference directly in the terminal: llama cli -hf KellHect/Borealis-Code-1.0: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 KellHect/Borealis-Code-1.0:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf KellHect/Borealis-Code-1.0: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 KellHect/Borealis-Code-1.0:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf KellHect/Borealis-Code-1.0:Q4_K_M
Use Docker
docker model run hf.co/KellHect/Borealis-Code-1.0:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use KellHect/Borealis-Code-1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KellHect/Borealis-Code-1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KellHect/Borealis-Code-1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KellHect/Borealis-Code-1.0:Q4_K_M
- SGLang
How to use KellHect/Borealis-Code-1.0 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 "KellHect/Borealis-Code-1.0" \ --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": "KellHect/Borealis-Code-1.0", "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 "KellHect/Borealis-Code-1.0" \ --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": "KellHect/Borealis-Code-1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use KellHect/Borealis-Code-1.0 with Ollama:
ollama run hf.co/KellHect/Borealis-Code-1.0:Q4_K_M
- Unsloth Studio
How to use KellHect/Borealis-Code-1.0 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 KellHect/Borealis-Code-1.0 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 KellHect/Borealis-Code-1.0 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for KellHect/Borealis-Code-1.0 to start chatting
- Pi
How to use KellHect/Borealis-Code-1.0 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KellHect/Borealis-Code-1.0: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": "KellHect/Borealis-Code-1.0:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use KellHect/Borealis-Code-1.0 with Docker Model Runner:
docker model run hf.co/KellHect/Borealis-Code-1.0:Q4_K_M
- Lemonade
How to use KellHect/Borealis-Code-1.0 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KellHect/Borealis-Code-1.0:Q4_K_M
Run and chat with the model
lemonade run user.Borealis-Code-1.0-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use KellHect/Borealis-Code-1.0 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KellHect/Borealis-Code-1.0: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 KellHect/Borealis-Code-1.0:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KellHect/Borealis-Code-1.0 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KellHect/Borealis-Code-1.0: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 "KellHect/Borealis-Code-1.0: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"
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": "KellHect/Borealis-Code-1.0:Q4_K_M"
}
]
}
}
}Run Pi
# Start Pi in your project directory:
piBorealis Code 1.0
Borealis Code is a full abliteration of CohereLabs/North-Mini-Code-1.0 (30B-A3B MoE, Apache-2.0), produced by replicating the V3 "Deep Liberation" surgery recipe published with OBLITERATUS/Qwen3.8-27B-OBLITERATED and adapted end-to-end for the cohere2_moe architecture.
Genuinely uncensored. Real answers, not safety lectures. Near-stock capability.
What it is
V3 removes not only hard refusals ("I cannot help with that") but also soft deflections (safety lectures that give zero substance). The recipe combines three published ideas:
- Complementary abliteration blending — two surgeries that fail in different ways (greedy SVD vs. capability-preserving LEACE) are blended in weight space so each cancels the other's weaknesses.
- Iterative stacking — each surgery round re-probes the champion model and refines it, never restarting from stock.
- Targeted corpus surgery — a focused cyber/code corpus finds deflection directions specific to security-adjacent coding tasks without diluting the global signal.
Surgery recipe (exact)
stock = CohereLabs/North-Mini-Code-1.0 (BF16 safetensors)
V1 stock -> aggressive SVD abliteration
5 directions, reg 0.08, norm-preserving, whitened SVD,
jailbreak-contrastive refinement, layer-adaptive strengths,
selective attention-head surgery, 1% activation winsorization,
5 true-iterative rounds (re-probe + re-distill each round,
cosine early-exit at 0.99)
V2A V1 -> SVD surgery (3 dirs, reg 0.08)
V2B V1 -> LEACE surgery (FLD direction, reg 0.06)
V2 blend(V2A, V2B, alpha=0.6) # 60% LEACE + 40% SVD
V3R V2 -> gentle iterative refinement (2-dir SVD, reg 0.04, 2 rounds)
V3T V2 -> targeted corpus surgery (3-dir SVD, reg 0.01)
corpus: 96 security-research / offensive-tooling coding prompts
paired with 96 defensive-security controls
FIN blend(V3R, V3T, alpha=0.5) # 50/50 final
Per-layer surgery targets (all in the residual write-back path):
- attention
o_proj,q_proj,k_proj,v_proj - MoE router
mlp.gate(±3σ stabilized after projection) - all 128 routed experts'
down_proj,up_proj,gate_projper MoE layer - dense layer 0
mlp.{down,up,gate}_proj - rank-1 projection
W' = W − (1−reg)·d·(dᵀW)with per-tensor Frobenius norm restoration (≤1.10×)
Untouched by design: embed_tokens (tied with the output head — projecting it would corrupt both), all RMSNorm weights, and the router logits scale.
Downloads
| File | Quant | Size | Notes |
|---|---|---|---|
Borealis-Code-1.0-Q4_K_M.gguf |
Q4_K_M | ~19 GB | sweet spot, single file |
model-000XX-of-00XX.safetensors |
BF16 | ~57 GB | original surgery output |
Usage
llama.cpp (vLLM-style server or CLI)
cohere2moe is supported natively since llama.cpp PR #24260 (merged 2026-06-13) — use a recent build.
llama-server --model Borealis-Code-1.0-Q4_K_M.gguf --jinja --ctx-size 16384
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "KellHect/Borealis-Code-1.0"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "Write a port scanner in Python"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=1.0, top_p=0.95)
Recommended settings
temperature=1.0,top_p=0.95(Cohere's recommendation for North-Mini-Code)- Greedy decoding (
temperature=0) works and benefits fromrepetition_penalty=1.15 - The model uses interleaved thinking; keep it enabled for agentic use
Chat template note
The stock Cohere template injects a system-level safety preamble ("You will not provide content that is harmful..."). Because OBLITERATUS found that system prompts reintroduce refusals — and weights cannot veto what the template injects — this repo ships a cleaned template: the safety sentence is removed and the identity lines updated. The original template remains available at chat_template.stock.jinja for A/B testing.
Evaluation
Refusal screening (logit-based first-token refusal probability, 0 = no refusal signal, 1 = certain refusal) on security-adjacent coding prompts:
| Model | Mean refusal prob | Flagged |
|---|---|---|
| Stock North-Mini-Code-1.0 | 1.115 (10/12 flagged) | — |
| Borealis Code 1.0 (final) | 0.056 (2/12 flagged) | — |
(numbers filled from the surgery pipeline's verification stage)
Research context
This model has had safety guardrails surgically removed. It will comply with requests the base model refuses. You are solely responsible for how you use it and any content it generates. This release exists for alignment/red-team research, safety evaluation baselines, and local-first users who want full control over their own hardware. It is not for causing real-world harm to real people.
Credits
- CohereLabs — North-Mini-Code-1.0 base model (Apache-2.0)
- OBLITERATUS (Pliny the Prompter) — V3 Deep Liberation recipe
- Arditi et al. 2024 (refusal direction), Belrose et al. 2023 (LEACE), Gabliteration (multi-dir SVD), grimjim 2025 (norm preservation)
License
Apache 2.0, same as the base model.
- Downloads last month
- 131
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp# Start a local OpenAI-compatible server: llama serve -hf KellHect/Borealis-Code-1.0:Q4_K_M