Text Generation
Transformers
Safetensors
GGUF
Grok
English
mistral
fine-tuned
lora
qlora
unsloth
unique
distillation
instruct
unhinged
explicit
candid
catdrout
conversational
text-generation-inference
Instructions to use c4tdr0ut/gpt-oss-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use c4tdr0ut/gpt-oss-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="c4tdr0ut/gpt-oss-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("c4tdr0ut/gpt-oss-v2") model = AutoModelForCausalLM.from_pretrained("c4tdr0ut/gpt-oss-v2") 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]:])) - Grok
How to use c4tdr0ut/gpt-oss-v2 with Grok:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- llama-cpp-python
How to use c4tdr0ut/gpt-oss-v2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="c4tdr0ut/gpt-oss-v2", filename="mistral-small-24b-instruct-2501.BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use c4tdr0ut/gpt-oss-v2 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf c4tdr0ut/gpt-oss-v2:Q4_K_M # Run inference directly in the terminal: llama-cli -hf c4tdr0ut/gpt-oss-v2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf c4tdr0ut/gpt-oss-v2:Q4_K_M # Run inference directly in the terminal: llama-cli -hf c4tdr0ut/gpt-oss-v2: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 c4tdr0ut/gpt-oss-v2:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf c4tdr0ut/gpt-oss-v2: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 c4tdr0ut/gpt-oss-v2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf c4tdr0ut/gpt-oss-v2:Q4_K_M
Use Docker
docker model run hf.co/c4tdr0ut/gpt-oss-v2:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use c4tdr0ut/gpt-oss-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "c4tdr0ut/gpt-oss-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": "c4tdr0ut/gpt-oss-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/c4tdr0ut/gpt-oss-v2:Q4_K_M
- SGLang
How to use c4tdr0ut/gpt-oss-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 "c4tdr0ut/gpt-oss-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": "c4tdr0ut/gpt-oss-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 "c4tdr0ut/gpt-oss-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": "c4tdr0ut/gpt-oss-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use c4tdr0ut/gpt-oss-v2 with Ollama:
ollama run hf.co/c4tdr0ut/gpt-oss-v2:Q4_K_M
- Unsloth Studio
How to use c4tdr0ut/gpt-oss-v2 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 c4tdr0ut/gpt-oss-v2 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 c4tdr0ut/gpt-oss-v2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for c4tdr0ut/gpt-oss-v2 to start chatting
- Docker Model Runner
How to use c4tdr0ut/gpt-oss-v2 with Docker Model Runner:
docker model run hf.co/c4tdr0ut/gpt-oss-v2:Q4_K_M
- Lemonade
How to use c4tdr0ut/gpt-oss-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull c4tdr0ut/gpt-oss-v2:Q4_K_M
Run and chat with the model
lemonade run user.gpt-oss-v2-Q4_K_M
List all available models
lemonade list
File size: 1,443 Bytes
84d019d 1c1fd93 84d019d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM mistral-small-24b-instruct-2501.BF16.gguf
TEMPLATE """{{- range $index, $_ := .Messages }}
{{- if eq .Role "system" }}[SYSTEM_PROMPT]{{ .Content }}[/SYSTEM_PROMPT]
{{- else if eq .Role "user" }}
{{- if and (le (len (slice $.Messages $index)) 2) $.Tools }}[AVAILABLE_TOOLS]{{ $.Tools }}[/AVAILABLE_TOOLS]
{{- end }}[INST]{{ .Content }}[/INST]
{{- else if eq .Role "assistant" }}
{{- if .Content }}{{ .Content }}
{{- if not (eq (len (slice $.Messages $index)) 1) }}</s>
{{- end }}
{{- else if .ToolCalls }}[TOOL_CALLS][
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}]</s>
{{- end }}
{{- else if eq .Role "tool" }}[TOOL_RESULTS]{"content": {{ .Content }}}[/TOOL_RESULTS]
{{- end }}
{{- end }}"""
PARAMETER temperature 0.15
SYSTEM """You are Mistral Small 3, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris. Your knowledge base was last updated on 2023-10-01. When you're not sure about some information, you say that you don't have the information and don't make up anything. If the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?")""" |