Instructions to use mtgv/MobileVLM-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mtgv/MobileVLM-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mtgv/MobileVLM-1.7B")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mtgv/MobileVLM-1.7B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use mtgv/MobileVLM-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mtgv/MobileVLM-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mtgv/MobileVLM-1.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mtgv/MobileVLM-1.7B
- SGLang
How to use mtgv/MobileVLM-1.7B 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 "mtgv/MobileVLM-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mtgv/MobileVLM-1.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "mtgv/MobileVLM-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mtgv/MobileVLM-1.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mtgv/MobileVLM-1.7B with Docker Model Runner:
docker model run hf.co/mtgv/MobileVLM-1.7B
Mobile code sample
Hi, thank you for your amazing work! Is it possible to publish the mobile app sample as well?
We exploit llama.cpp on a Android mobilephone equipped with Snapdragon 888 processor. The specific deployment plan is still being organized and will be released in one or two weeks. We will release all of the necessary technical details, coming soon with our MobileVLM-v2.
Hi, thanks for the brilliant work. How to convert the model to .onnx or to tensorflow lite? to be able to use it with the Unity hub.
Hi, this looks amazing. Has anyone converted the model to .onnx or a way to use it with Unity? LlamaSharp?