Instructions to use rahul7star/GPT-OSS-20B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rahul7star/GPT-OSS-20B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rahul7star/GPT-OSS-20B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rahul7star/GPT-OSS-20B") model = AutoModelForCausalLM.from_pretrained("rahul7star/GPT-OSS-20B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rahul7star/GPT-OSS-20B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rahul7star/GPT-OSS-20B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rahul7star/GPT-OSS-20B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rahul7star/GPT-OSS-20B
- SGLang
How to use rahul7star/GPT-OSS-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 "rahul7star/GPT-OSS-20B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rahul7star/GPT-OSS-20B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "rahul7star/GPT-OSS-20B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rahul7star/GPT-OSS-20B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rahul7star/GPT-OSS-20B with Docker Model Runner:
docker model run hf.co/rahul7star/GPT-OSS-20B
Add config.json from PathFinderKR/gpt-oss-20b-expert0
Browse files- config.json +78 -0
config.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GptOssForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": true,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"dtype": "bfloat16",
|
| 8 |
+
"eos_token_id": 200002,
|
| 9 |
+
"experts_per_token": 4,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 2880,
|
| 13 |
+
"initial_context_length": 4096,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 2880,
|
| 16 |
+
"layer_types": [
|
| 17 |
+
"sliding_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"sliding_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"sliding_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"full_attention"
|
| 41 |
+
],
|
| 42 |
+
"max_position_embeddings": 131072,
|
| 43 |
+
"model_type": "gpt_oss",
|
| 44 |
+
"num_attention_heads": 64,
|
| 45 |
+
"num_experts_per_tok": 1,
|
| 46 |
+
"num_hidden_layers": 24,
|
| 47 |
+
"num_key_value_heads": 8,
|
| 48 |
+
"num_local_experts": 1,
|
| 49 |
+
"output_router_logits": false,
|
| 50 |
+
"pad_token_id": 199999,
|
| 51 |
+
"quantization_config": {
|
| 52 |
+
"modules_to_not_convert": [
|
| 53 |
+
"model.layers.*.self_attn",
|
| 54 |
+
"model.layers.*.mlp.router",
|
| 55 |
+
"model.embed_tokens",
|
| 56 |
+
"lm_head"
|
| 57 |
+
],
|
| 58 |
+
"quant_method": "mxfp4"
|
| 59 |
+
},
|
| 60 |
+
"rms_norm_eps": 1e-05,
|
| 61 |
+
"rope_scaling": {
|
| 62 |
+
"beta_fast": 32.0,
|
| 63 |
+
"beta_slow": 1.0,
|
| 64 |
+
"factor": 32.0,
|
| 65 |
+
"original_max_position_embeddings": 4096,
|
| 66 |
+
"rope_type": "yarn",
|
| 67 |
+
"truncate": false
|
| 68 |
+
},
|
| 69 |
+
"rope_theta": 150000,
|
| 70 |
+
"router_aux_loss_coef": 0.9,
|
| 71 |
+
"sliding_window": 128,
|
| 72 |
+
"swiglu_limit": 7.0,
|
| 73 |
+
"tie_word_embeddings": false,
|
| 74 |
+
"top_k": null,
|
| 75 |
+
"transformers_version": "4.56.0",
|
| 76 |
+
"use_cache": true,
|
| 77 |
+
"vocab_size": 201088
|
| 78 |
+
}
|