Instructions to use facebook/DepthLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/DepthLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="facebook/DepthLM") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("facebook/DepthLM") model = AutoModelForImageTextToText.from_pretrained("facebook/DepthLM") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use facebook/DepthLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/DepthLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "facebook/DepthLM", "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/facebook/DepthLM
- SGLang
How to use facebook/DepthLM 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 "facebook/DepthLM" \ --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": "facebook/DepthLM", "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 "facebook/DepthLM" \ --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": "facebook/DepthLM", "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 facebook/DepthLM with Docker Model Runner:
docker model run hf.co/facebook/DepthLM
Any plan to release DepthLM 3B/7B checkpoints (or a distilled/lightweight variant)?
Hi DepthLM team, thanks for releasing the model/code!
I’m working on a research/engineering project based on DepthLM and would like to deploy it on resource-limited hardware (e.g., 1–2 GPUs or embedded devices).
In the paper it’s mentioned that smaller variants (3B/7B) were trained, but I couldn’t find public checkpoints yet.
Questions:
- “Do you plan to release the 3B/7B checkpoints (or a distilled/lighter version) publicly?”
- “If not, is there a recommended recipe for reproducing a smaller model (e.g., distillation settings, target backbones, quantization/export suggestions)?”
Any guidance would be greatly appreciated. Thank you!
Thx for the interest! Unfortunately, due to the policy constraints, we cannot release the 3b and 7b models. However, we have released the training code to enable full reproduction. To enable your application, I would suggest you try on smaller scale training then our full paper, sth like 8M images + 3b model + lora should give you sufficient performance while requiring reasonable amount of training resources. Hope this helps. You can also perform distillation by using our 12B released model, which should allow you to use small VLMs on customized datasets.
Hi DepthLM team, thanks for releasing the model/code!
I’m working on a research/engineering project based on DepthLM and would like to deploy it on resource-limited hardware (e.g., 1–2 GPUs or embedded devices).
In the paper it’s mentioned that smaller variants (3B/7B) were trained, but I couldn’t find public checkpoints yet.
Questions:
- “Do you plan to release the 3B/7B checkpoints (or a distilled/lighter version) publicly?”
- “If not, is there a recommended recipe for reproducing a smaller model (e.g., distillation settings, target backbones, quantization/export suggestions)?”
Any guidance would be greatly appreciated. Thank you!
Good news, we are working on the 3b/7b model release, if things go well, they should be ready in couple weeks. Stay tuned!