Instructions to use ArliAI/gpt-oss-20b-Derestricted with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArliAI/gpt-oss-20b-Derestricted with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ArliAI/gpt-oss-20b-Derestricted") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ArliAI/gpt-oss-20b-Derestricted") model = AutoModelForCausalLM.from_pretrained("ArliAI/gpt-oss-20b-Derestricted") 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
- vLLM
How to use ArliAI/gpt-oss-20b-Derestricted with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ArliAI/gpt-oss-20b-Derestricted" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ArliAI/gpt-oss-20b-Derestricted", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ArliAI/gpt-oss-20b-Derestricted
- SGLang
How to use ArliAI/gpt-oss-20b-Derestricted 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 "ArliAI/gpt-oss-20b-Derestricted" \ --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": "ArliAI/gpt-oss-20b-Derestricted", "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 "ArliAI/gpt-oss-20b-Derestricted" \ --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": "ArliAI/gpt-oss-20b-Derestricted", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ArliAI/gpt-oss-20b-Derestricted with Docker Model Runner:
docker model run hf.co/ArliAI/gpt-oss-20b-Derestricted
wtf man
seems very smart at most things...shits itself at function calling and hallucinates tools and tool outputs
seems very smart at most things...shits itself at function calling and hallucinates tools and tool outputs
Same thing happens in Talemate, which is an agentic RP platform. After a lot of tweaking I got it down to 1 in 4 tool / agent calls going fully off the rails. Very unreliable for any agentic system / tool calling. In my experience it's true for all version of GPT-OSS I've tried, except for the base version. Maybe there is a magic set of presets out there for this model, but I haven't found them yet.
But why doesn’t it work
I'm no expert at this, but from my understanding it has something to do with the fine-tuning process. The process of ablation/desrestriction is, right now, not like a tiny surgical incision removing or tweaking alignment. It's more akin to a lobotomy, unrestricted but also less intelligent, or in this case less skilful. Depending on someone's use case they might never really notice it.
Huh
@grimjim thoughts?
From a theoretical standpoint:
With some models, preserving norms/magnitudes is a good thing; others not so much. It's probably a good idea for MoE, but the devil's in the details.
Projecting out the refusal contribution along the harmless direction and orthogonalizing it reduces damage, by minimizing change along the harmless direction itself and around it. That's how that (sub)technique maintains more baseline performance.
This model is heavily quantized given its floating point represenations, so it's possible that requanting post-abliteration could induce additional quant damage, even if intermediate calculations are performed with 32-bit floating point.
Isn't GPT-OSS natively MXFP4? so if you take the mxfp4, up to fp32, perform the ablation and then downscale back to mxfp4, why should there me a major loss in quality
I would venture that training of GPT-OSS was quant-aware, to reduce loss due to downscaling. Ablation is currently not.
This post from Nvidia lays out a possible method, except we've ablated instead of performing SFT for step 2.
https://developer.nvidia.com/blog/fine-tuning-gpt-oss-for-accuracy-and-performance-with-quantization-aware-training/
I eternally wait for a QAT version of this


