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
Download params.json from yujiepan/mistral-large-4-tiny-random: direct link, hf CLI and curl.
- Browser
- Download file 2.4 kB
-
https://huggingface.co/yujiepan/mistral-large-4-tiny-random/resolve/main/params.json
- Command line
-
hf download hf://yujiepan/mistral-large-4-tiny-random/params.json
-
curl -L -o params.json https://huggingface.co/yujiepan/mistral-large-4-tiny-random/resolve/main/params.json
2.4 kB
| { | |
| "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" | |
| } | |
| } | |
| } | |