Instructions to use optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4
- SGLang
How to use optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4 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 "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4" \ --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": "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4", "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 "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4" \ --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": "optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4 with Docker Model Runner:
docker model run hf.co/optimum-intel-internal-testing/tiny-random-gpt-oss-mxfp4
Fix: add rope_theta inside rope_scaling for transformers >= v5.4 compatibility
#2
by echarlaix HF Staff - opened
- config.json +3 -50
config.json
CHANGED
|
@@ -1,50 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 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": 32,
|
| 11 |
-
"hidden_act": "silu",
|
| 12 |
-
"hidden_size": 32,
|
| 13 |
-
"initial_context_length": 4096,
|
| 14 |
-
"initializer_range": 0.02,
|
| 15 |
-
"intermediate_size": 64,
|
| 16 |
-
"layer_types": [
|
| 17 |
-
"sliding_attention",
|
| 18 |
-
"full_attention"
|
| 19 |
-
],
|
| 20 |
-
"max_position_embeddings": 131072,
|
| 21 |
-
"model_type": "gpt_oss",
|
| 22 |
-
"num_attention_heads": 2,
|
| 23 |
-
"num_experts_per_tok": 4,
|
| 24 |
-
"num_hidden_layers": 2,
|
| 25 |
-
"num_key_value_heads": 1,
|
| 26 |
-
"num_local_experts": 32,
|
| 27 |
-
"output_router_logits": false,
|
| 28 |
-
"pad_token_id": 199999,
|
| 29 |
-
"quantization_config": {
|
| 30 |
-
"modules_to_not_convert": null,
|
| 31 |
-
"quant_method": "mxfp4"
|
| 32 |
-
},
|
| 33 |
-
"rms_norm_eps": 1e-05,
|
| 34 |
-
"rope_scaling": {
|
| 35 |
-
"beta_fast": 32.0,
|
| 36 |
-
"beta_slow": 1.0,
|
| 37 |
-
"factor": 32.0,
|
| 38 |
-
"original_max_position_embeddings": 4096,
|
| 39 |
-
"rope_type": "yarn",
|
| 40 |
-
"truncate": false
|
| 41 |
-
},
|
| 42 |
-
"rope_theta": 150000,
|
| 43 |
-
"router_aux_loss_coef": 0.9,
|
| 44 |
-
"sliding_window": 128,
|
| 45 |
-
"swiglu_limit": 7.0,
|
| 46 |
-
"tie_word_embeddings": true,
|
| 47 |
-
"transformers_version": "4.56.2",
|
| 48 |
-
"use_cache": true,
|
| 49 |
-
"vocab_size": 201088
|
| 50 |
-
}
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fdd08f30b14b17a27bb68e5c0fec1291f619140d8724fc14bf7204f105d771d2
|
| 3 |
+
size 1212
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|