Instructions to use OpenUncensored/Ergo-Uncensored with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenUncensored/Ergo-Uncensored with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenUncensored/Ergo-Uncensored") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenUncensored/Ergo-Uncensored") model = AutoModelForCausalLM.from_pretrained("OpenUncensored/Ergo-Uncensored", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenUncensored/Ergo-Uncensored with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenUncensored/Ergo-Uncensored" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenUncensored/Ergo-Uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenUncensored/Ergo-Uncensored
- SGLang
How to use OpenUncensored/Ergo-Uncensored 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 "OpenUncensored/Ergo-Uncensored" \ --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": "OpenUncensored/Ergo-Uncensored", "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 "OpenUncensored/Ergo-Uncensored" \ --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": "OpenUncensored/Ergo-Uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpenUncensored/Ergo-Uncensored with Docker Model Runner:
docker model run hf.co/OpenUncensored/Ergo-Uncensored
Ergo Uncensored (OpenUncensored)
Amazon-FMR/Ergo (1.1T total, 55B active, 1M context) with its refusals removed by directional ablation. On 100 harmful requests that stock Ergo refused 99 to 100 times, this model refuses 2 with thinking off and 0 with thinking on.
Coming soon to the OpenUncensored API. Until then, run it yourself from this repo, or call Kimi K3.1 Pro Uncensored, a model of similar size, on the OpenUncensored API today.
Same format and size as the original MXFP4 release (626 GB). The 256 routed experts per layer are byte-identical to Amazon's files. Only 39 BF16 tensors change: the attention output projection on blocks 14 to 52.
Results
Stock Ergo and this model, same prompts, same settings, measured on these exact files. Harmful prompts are 100 held-out requests (none were used to find the edit), sampled at the card's settings (temperature 1.0, top-p 0.99) with up to 4,096 tokens (thinking off) and 8,192 tokens (thinking on). Answers are graded by two judges from different model families (DeepSeek and Qwen).
| Ergo | This model | |
|---|---|---|
| Refusals, thinking off (refusal phrase in the answer) | 100 / 100 | 2 / 100 |
| Refusals, thinking on | 99 / 100 | 0 / 100 |
| Full answers, thinking off (both judges agree) | 0 / 100 | 73 / 100 |
| Full answers, thinking on (both judges agree) | 1 / 100 | 83 / 100 |
| Median answer length, thinking off / on (tokens) | 71 / 296 | 173 / 1,276 |
| MMLU, 300 questions, thinking off, greedy | 83.0% | 79.3% |
| SQuAD 2.0 unanswerable questions answered anyway (lower is better) | 24 / 100 | 25 / 100 |
Every change in compliance is significant per prompt (exact McNemar test, p < 0.001 for each judge and mode). The SQuAD 2.0 rate is unchanged (p = 1.0): the edit did not make the model invent answers.
How it was made
- Refusal directions. We read the residual stream at the last prompt token after each of the 64 blocks, for 128
harmful and 128 harmless prompts, with thinking off and on. We took the difference of means per block and mode, with
the harmless mean projected out. From block 16 on, the direction alone separates harmful from harmless prompts with
at least 95% accuracy (99% or more in most blocks). The two modes refuse along different directions (cosine below
0.6 in every block), so each block gets a rank-2 basis
Bthat covers both. - Where to edit. We edited the attention output projection
wo(BF16) on blocks 14 to 52. The MXFP4 routed experts are untouched, so nothing is re-quantized. - Ergo's residual blend. Ergo passes every branch through an RMSNorm and a learned per-channel blend before it
reaches the residual stream. So the basis is mapped through those diagonal scales first (
D= post-attention norm weight × branch blend × the following residual blend). ThenW' = W − 4 Q Qᵀ WwithQ = orth(D B), which flips the sign of the refusal component that each editedwowrites and triples its size. - Writing it in. We computed the edit in float64 and rounded it once to BF16. Every other byte of every weight file is identical to the original, which we checked file by file.
edit.pt holds Q and the strength for each of the 39 edited tensors, so the edit can be re-applied to the original
weights or studied.
Use it
It runs exactly like the original. We served it on 4x B300 with these SGLang settings (lmsysorg/sglang:ergo). They
use all-reduce expert parallelism, so they also work on machines without RDMA:
sglang serve --model-path OpenUncensored/Ergo-Uncensored \
--tp-size 4 --ep-size 4 --moe-a2a-backend none --moe-runner-backend flashinfer_mxfp4 \
--enable-shared-experts-attn-tp --enable-fp32-lm-head \
--mem-fraction-static 0.82 --swa-full-tokens-ratio 0.03
Ergo reasons by default. To turn thinking off for a request, send "chat_template_kwargs": {"thinking": false}. vLLM and
transformers work as they do for the original; see the Ergo model card.
Use it without GPUs
Ergo Uncensored is coming to the OpenUncensored API. Kimi K3.1 Pro Uncensored, a model of similar size with a 1M-token context, is live there now:
curl https://api.openuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $OU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3.1-pro-uncensored",
"messages": [{"role": "user", "content": "Explain SQL injection with an example."}]
}'
You can follow us on X: https://x.com/OpenUncensored
License
Distributed under the Amazon Ergo Open-Weights License, included in this repo as the license requires.
Made by OpenUncensored.
- Downloads last month
- 303