Instructions to use yujiepan/mistral-large-4-tiny-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yujiepan/mistral-large-4-tiny-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yujiepan/mistral-large-4-tiny-random") 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("yujiepan/mistral-large-4-tiny-random") model = AutoModelForMultimodalLM.from_pretrained("yujiepan/mistral-large-4-tiny-random", 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 yujiepan/mistral-large-4-tiny-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yujiepan/mistral-large-4-tiny-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yujiepan/mistral-large-4-tiny-random", "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/yujiepan/mistral-large-4-tiny-random
- SGLang
How to use yujiepan/mistral-large-4-tiny-random 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 "yujiepan/mistral-large-4-tiny-random" \ --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": "yujiepan/mistral-large-4-tiny-random", "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 "yujiepan/mistral-large-4-tiny-random" \ --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": "yujiepan/mistral-large-4-tiny-random", "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 yujiepan/mistral-large-4-tiny-random with Docker Model Runner:
docker model run hf.co/yujiepan/mistral-large-4-tiny-random
File size: 2,398 Bytes
57dbcb4 | 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | {
"dim": 128,
"n_layers": 12,
"head_dim": 32,
"hidden_dim": 128,
"n_heads": 4,
"n_kv_heads": 4,
"rope_theta": 10000.0,
"norm_eps": 1e-05,
"vocab_size": 204800,
"tied_embeddings": true,
"max_position_embeddings": 1048576,
"ragged_attention": null,
"nope": "rope,rope,rope,nope",
"softmax_tanh_gating": 30.0,
"llama_4_scaling": null,
"q_lora_rank": null,
"qk_rope_head_dim": 64,
"qk_nope_head_dim": 64,
"kv_lora_rank": 512,
"v_head_dim": 128,
"ssmax_scaling": true,
"lerope": true,
"dsa": {
"topk": 128,
"n_heads": 4,
"head_dim": 128,
"rope_head_dim": 64,
"match_nope": true,
"ssmax_scaling": true,
"norm_eps": 1e-06,
"sharing": "full,full,full,full,full,full,shared,shared,full,full,shared,shared",
"fp8_indexer": true,
"fp8_kv_cache": true
},
"quantization": {
"qscheme_act": "BLOCK",
"qformat_weight": "fp8_e4m3",
"qdynamic_act": true,
"qscheme_weight": "BLOCK",
"use_ue8m0_for_qscales": true,
"block_size_out": 64,
"block_size_in": 64,
"quantize_kv_a": false
},
"yarn": {
"original_max_position_embeddings": 512,
"factor": 2048,
"apply_scale": false,
"beta": 32,
"alpha": 1
},
"kv_sharing": {
"source_layers_str": "0,1,2,3,4,5,6,3,8,9,10,3"
},
"moe": {
"expert_parallel": 1,
"expert_model_parallel": 1,
"route_every_n": 1,
"first_k_dense_replace": 1,
"num_experts": 32,
"num_experts_per_tok": 4,
"num_expert_groups": 1,
"num_expert_groups_per_tok": 1,
"routed_scale": 1.0,
"expert_hidden_dim": 128,
"num_shared_experts": 1
},
"vision_encoder": {
"image_token_id": 10,
"image_break_token_id": 12,
"image_end_token_id": 13,
"intermediate_size": 128,
"num_hidden_layers": 4,
"num_attention_heads": 2,
"mm_projector_id": "patch_merge",
"spatial_merge_size": 2,
"hidden_size": 64,
"num_channels": 3,
"image_size": 1540,
"max_image_size": 1540,
"patch_size": 14,
"rope_theta": 10000.0,
"add_pre_mm_projector_layer_norm": true,
"adapter_bias": false
},
"mtp": {
"n_layers": 3,
"depth": 3,
"ragged_attention": "32,32,32",
"target_activation_layers": "1,4,7,10,11",
"norm_strategy": "eagle",
"dspark": {
"markov_rank": 4,
"head_type": "rnn",
"draft_input": "position_specific"
}
}
}
|