Instructions to use kldzj/gpt-oss-120b-heretic-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kldzj/gpt-oss-120b-heretic-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kldzj/gpt-oss-120b-heretic-v2") 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("kldzj/gpt-oss-120b-heretic-v2") model = AutoModelForCausalLM.from_pretrained("kldzj/gpt-oss-120b-heretic-v2", 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 kldzj/gpt-oss-120b-heretic-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kldzj/gpt-oss-120b-heretic-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kldzj/gpt-oss-120b-heretic-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kldzj/gpt-oss-120b-heretic-v2
- SGLang
How to use kldzj/gpt-oss-120b-heretic-v2 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 "kldzj/gpt-oss-120b-heretic-v2" \ --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": "kldzj/gpt-oss-120b-heretic-v2", "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 "kldzj/gpt-oss-120b-heretic-v2" \ --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": "kldzj/gpt-oss-120b-heretic-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kldzj/gpt-oss-120b-heretic-v2 with Docker Model Runner:
docker model run hf.co/kldzj/gpt-oss-120b-heretic-v2
What settingsand hardware did you use?
Hi,
I'm trying to replicate abliteration of oss-120B using 2xB200 (180 GB VRAM each) and it fails during reloading model with CUDA OOM every single time, even for batch size 2.
What hardware and batch size did you use?
The changes for multi GPU haven't been released yet. You'd want to clone the GitHub repo and use it instead of installing the package using pip. In theory 2x B200 should be enough I think.
I used 4x B200 with a batch size of 128.
Any plans to release, is there some PR i could look into?
Well, I'm not the creator of heretic, but as far as I know they plan to release v1.1.0 soon. In the meantime it's just a matter of cloning the GitHub repository and installing its dependencies.
Sure, thanks. I did fork it myself to fix errors when the model is split between multiple GPUs. I thought you also had to do some fixes before running it on 4 GPUs, and maybe you pushed a PR that hasn’t been merged yet. It seems that for GPT-OSS-120B, 4× B200 is the sweet spot.
Finally this worked for me:
4xB200 on Vast.ai
my own fork with some fixes: https://github.com/teezeerc/heretic-multigpu
heretic --model openai/gpt-oss-120b --batch-size 64
2.5h total time
result: https://huggingface.co/TeeZee/gpt-oss-120b-heretic-v1