Instructions to use optimum-intel-internal-testing/tiny-random-qwen38-flash-next 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-qwen38-flash-next with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="optimum-intel-internal-testing/tiny-random-qwen38-flash-next") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("optimum-intel-internal-testing/tiny-random-qwen38-flash-next") model = AutoModelForMultimodalLM.from_pretrained("optimum-intel-internal-testing/tiny-random-qwen38-flash-next", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use optimum-intel-internal-testing/tiny-random-qwen38-flash-next 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-qwen38-flash-next" # 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-qwen38-flash-next", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/optimum-intel-internal-testing/tiny-random-qwen38-flash-next
- SGLang
How to use optimum-intel-internal-testing/tiny-random-qwen38-flash-next 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-qwen38-flash-next" \ --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-qwen38-flash-next", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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-qwen38-flash-next" \ --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-qwen38-flash-next", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use optimum-intel-internal-testing/tiny-random-qwen38-flash-next with Docker Model Runner:
docker model run hf.co/optimum-intel-internal-testing/tiny-random-qwen38-flash-next
Add the Multi-Token Prediction head and a model card
#1
by rkazants - opened
Adds the Multi-Token Prediction (MTP) head of Qwen3.8-Flash-Next to the tiny model, as in the real checkpoint.
What changes
model.safetensors: 31mtp.*tensors (one QSA decoder layer with hyper-connections and MoE,fc_embedding,fc_hidden, the pre-fc norms and the head'shyper_connection_mixer), named as in the real checkpoint.config.json: the realmtpsection (1 QSA layer) andmtp_num_hidden_layers0 β 1.README.md: a model card describing the architecture, the initialization and the health checks.
Compatibility
- The 243 main-model tensors are bit-identical to the current version, so existing tests are unaffected.
- transformers ignores
mtp.*when loading (_keys_to_ignore_on_load_unexpected).
Initialization and health checks
- The MTP weights use the same init scheme as the main model: layers std 0.25, router std 1.
- Checked on text, image and video prompts with a reference MTP forward that follows vLLM
qwen4_exp:- logits are finite, with std β 4 and median greedy top-2 margins of 0.55β0.82;
- 73β100% of positions get distinct predictions;
- all experts are used, and its QSA drops 23β93% of the visible tokens;
- the head depends on both of its inputs (next-token embedding and hidden streams);
- a chained second draft step stays healthy.
π€ Generated with Claude Code
rkazants changed pull request status to merged