Instructions to use unsloth/DeepSeek-V4-Flash-Vision-Exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/DeepSeek-V4-Flash-Vision-Exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/DeepSeek-V4-Flash-Vision-Exp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/DeepSeek-V4-Flash-Vision-Exp") model = AutoModelForCausalLM.from_pretrained("unsloth/DeepSeek-V4-Flash-Vision-Exp", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/DeepSeek-V4-Flash-Vision-Exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/DeepSeek-V4-Flash-Vision-Exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/DeepSeek-V4-Flash-Vision-Exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/DeepSeek-V4-Flash-Vision-Exp
- SGLang
How to use unsloth/DeepSeek-V4-Flash-Vision-Exp 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 "unsloth/DeepSeek-V4-Flash-Vision-Exp" \ --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": "unsloth/DeepSeek-V4-Flash-Vision-Exp", "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 "unsloth/DeepSeek-V4-Flash-Vision-Exp" \ --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": "unsloth/DeepSeek-V4-Flash-Vision-Exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/DeepSeek-V4-Flash-Vision-Exp with Docker Model Runner:
docker model run hf.co/unsloth/DeepSeek-V4-Flash-Vision-Exp
| { | |
| "vocab_size": 129280, | |
| "dim": 4096, | |
| "moe_inter_dim": 2048, | |
| "n_layers": 43, | |
| "n_hash_layers": 3, | |
| "n_mtp_layers": 3, | |
| "dspark_block_size": 5, | |
| "dspark_noise_token_id": 128799, | |
| "dspark_target_layer_ids": [40, 41, 42], | |
| "dspark_markov_rank": 256, | |
| "n_heads": 64, | |
| "n_routed_experts": 256, | |
| "n_shared_experts": 1, | |
| "n_activated_experts": 6, | |
| "score_func": "sqrtsoftplus", | |
| "route_scale": 1.5, | |
| "norm_eps": 1e-20, | |
| "swiglu_limit": 10.0, | |
| "q_lora_rank": 1024, | |
| "head_dim": 512, | |
| "rope_head_dim": 64, | |
| "o_groups": 8, | |
| "o_lora_rank": 1024, | |
| "window_size": 128, | |
| "original_seq_len": 65536, | |
| "rope_theta": 10000, | |
| "rope_factor": 16, | |
| "beta_fast": 32, | |
| "beta_slow": 1, | |
| "index_n_heads": 64, | |
| "index_head_dim": 128, | |
| "index_topk": 512, | |
| "hc_mult": 4, | |
| "hc_sinkhorn_iters": 20, | |
| "dtype": "fp8", | |
| "scale_fmt": "ue8m0", | |
| "expert_dtype": "fp4", | |
| "compress_rope_theta": 160000, | |
| "compress_ratios": [0, 0, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 128, 4, 0, 0, 0], | |
| "vision_n_layers": 32, | |
| "vision_dim": 1024, | |
| "vision_n_heads": 16, | |
| "vision_inter_dim": 2816, | |
| "vision_patch_size": 14, | |
| "vision_downsample_ratio": 3, | |
| "vision_max_n_token": 384, | |
| "vision_min_pixels": 147456, | |
| "vision_max_wh_ratio": 8 | |
| } | |