Text Generation
Transformers
Safetensors
gpt_oss
code-reasoning
coding
reasoning
problem-solving
algorithms
python
c++
competitive-programming
vllm
conversational
8-bit precision
mxfp4
Instructions to use GetSoloTech/GPT-OSS-Code-Reasoning-20B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GetSoloTech/GPT-OSS-Code-Reasoning-20B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GetSoloTech/GPT-OSS-Code-Reasoning-20B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GetSoloTech/GPT-OSS-Code-Reasoning-20B") model = AutoModelForCausalLM.from_pretrained("GetSoloTech/GPT-OSS-Code-Reasoning-20B") 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 GetSoloTech/GPT-OSS-Code-Reasoning-20B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GetSoloTech/GPT-OSS-Code-Reasoning-20B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GetSoloTech/GPT-OSS-Code-Reasoning-20B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GetSoloTech/GPT-OSS-Code-Reasoning-20B
- SGLang
How to use GetSoloTech/GPT-OSS-Code-Reasoning-20B 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 "GetSoloTech/GPT-OSS-Code-Reasoning-20B" \ --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": "GetSoloTech/GPT-OSS-Code-Reasoning-20B", "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 "GetSoloTech/GPT-OSS-Code-Reasoning-20B" \ --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": "GetSoloTech/GPT-OSS-Code-Reasoning-20B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GetSoloTech/GPT-OSS-Code-Reasoning-20B with Docker Model Runner:
docker model run hf.co/GetSoloTech/GPT-OSS-Code-Reasoning-20B
Upload config.json
Browse files- config.json +75 -67
config.json
CHANGED
|
@@ -1,69 +1,77 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
],
|
| 5 |
-
"
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
"sliding_attention",
|
| 27 |
-
"full_attention",
|
| 28 |
-
"sliding_attention",
|
| 29 |
-
"full_attention",
|
| 30 |
-
"sliding_attention",
|
| 31 |
-
"full_attention",
|
| 32 |
-
"sliding_attention",
|
| 33 |
-
"full_attention",
|
| 34 |
-
"sliding_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"sliding_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"sliding_attention",
|
| 39 |
-
"full_attention"
|
| 40 |
-
],
|
| 41 |
-
"max_position_embeddings": 131072,
|
| 42 |
-
"model_type": "gpt_oss",
|
| 43 |
-
"num_attention_heads": 64,
|
| 44 |
-
"num_experts_per_tok": 4,
|
| 45 |
-
"num_hidden_layers": 24,
|
| 46 |
-
"num_key_value_heads": 8,
|
| 47 |
-
"num_local_experts": 32,
|
| 48 |
-
"output_router_logits": false,
|
| 49 |
-
"pad_token_id": 199999,
|
| 50 |
-
"rms_norm_eps": 1e-05,
|
| 51 |
-
"rope_scaling": {
|
| 52 |
-
"beta_fast": 32.0,
|
| 53 |
-
"beta_slow": 1.0,
|
| 54 |
-
"factor": 32.0,
|
| 55 |
-
"original_max_position_embeddings": 4096,
|
| 56 |
-
"rope_type": "yarn",
|
| 57 |
-
"truncate": false
|
| 58 |
-
},
|
| 59 |
-
"rope_theta": 150000,
|
| 60 |
-
"router_aux_loss_coef": 0.9,
|
| 61 |
-
"sliding_window": 128,
|
| 62 |
-
"swiglu_limit": 7.0,
|
| 63 |
-
"tie_word_embeddings": false,
|
| 64 |
-
"torch_dtype": "bfloat16",
|
| 65 |
-
"transformers_version": "4.56.0.dev0",
|
| 66 |
-
"unsloth_version": "2025.8.4",
|
| 67 |
-
"use_cache": true,
|
| 68 |
-
"vocab_size": 201088
|
| 69 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GptOssForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": true,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"eos_token_id": 200002,
|
| 8 |
+
"experts_per_token": 4,
|
| 9 |
+
"head_dim": 64,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2880,
|
| 12 |
+
"initial_context_length": 4096,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 2880,
|
| 15 |
+
"layer_types": [
|
| 16 |
+
"sliding_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"sliding_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"full_attention"
|
| 40 |
+
],
|
| 41 |
+
"max_position_embeddings": 131072,
|
| 42 |
+
"model_type": "gpt_oss",
|
| 43 |
+
"num_attention_heads": 64,
|
| 44 |
+
"num_experts_per_tok": 4,
|
| 45 |
+
"num_hidden_layers": 24,
|
| 46 |
+
"num_key_value_heads": 8,
|
| 47 |
+
"num_local_experts": 32,
|
| 48 |
+
"output_router_logits": false,
|
| 49 |
+
"pad_token_id": 200017,
|
| 50 |
+
"quantization_config": {
|
| 51 |
+
"modules_to_not_convert": [
|
| 52 |
+
"model.layers.*.self_attn",
|
| 53 |
+
"model.layers.*.mlp.router",
|
| 54 |
+
"model.embed_tokens",
|
| 55 |
+
"lm_head"
|
| 56 |
],
|
| 57 |
+
"quant_method": "mxfp4"
|
| 58 |
+
},
|
| 59 |
+
"rms_norm_eps": 1e-05,
|
| 60 |
+
"rope_scaling": {
|
| 61 |
+
"beta_fast": 32.0,
|
| 62 |
+
"beta_slow": 1.0,
|
| 63 |
+
"factor": 32.0,
|
| 64 |
+
"original_max_position_embeddings": 4096,
|
| 65 |
+
"rope_type": "yarn",
|
| 66 |
+
"truncate": false
|
| 67 |
+
},
|
| 68 |
+
"rope_theta": 150000,
|
| 69 |
+
"router_aux_loss_coef": 0.9,
|
| 70 |
+
"sliding_window": 128,
|
| 71 |
+
"swiglu_limit": 7.0,
|
| 72 |
+
"tie_word_embeddings": false,
|
| 73 |
+
"transformers_version": "4.55.0",
|
| 74 |
+
"unsloth_fixed": true,
|
| 75 |
+
"use_cache": true,
|
| 76 |
+
"vocab_size": 201088
|
| 77 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|