Instructions to use remyxai/SpaceLLaVA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use remyxai/SpaceLLaVA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="remyxai/SpaceLLaVA") 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, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("remyxai/SpaceLLaVA") model = AutoModelForCausalLM.from_pretrained("remyxai/SpaceLLaVA") 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]:])) - llama-cpp-python
How to use remyxai/SpaceLLaVA with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="remyxai/SpaceLLaVA", filename="ggml-model-f16.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use remyxai/SpaceLLaVA with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf remyxai/SpaceLLaVA:F16 # Run inference directly in the terminal: llama-cli -hf remyxai/SpaceLLaVA:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf remyxai/SpaceLLaVA:F16 # Run inference directly in the terminal: llama-cli -hf remyxai/SpaceLLaVA:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf remyxai/SpaceLLaVA:F16 # Run inference directly in the terminal: ./llama-cli -hf remyxai/SpaceLLaVA:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf remyxai/SpaceLLaVA:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf remyxai/SpaceLLaVA:F16
Use Docker
docker model run hf.co/remyxai/SpaceLLaVA:F16
- LM Studio
- Jan
- vLLM
How to use remyxai/SpaceLLaVA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "remyxai/SpaceLLaVA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "remyxai/SpaceLLaVA", "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/remyxai/SpaceLLaVA:F16
- SGLang
How to use remyxai/SpaceLLaVA 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 "remyxai/SpaceLLaVA" \ --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": "remyxai/SpaceLLaVA", "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 "remyxai/SpaceLLaVA" \ --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": "remyxai/SpaceLLaVA", "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" } } ] } ] }' - Ollama
How to use remyxai/SpaceLLaVA with Ollama:
ollama run hf.co/remyxai/SpaceLLaVA:F16
- Unsloth Studio new
How to use remyxai/SpaceLLaVA with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for remyxai/SpaceLLaVA to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for remyxai/SpaceLLaVA to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for remyxai/SpaceLLaVA to start chatting
- Docker Model Runner
How to use remyxai/SpaceLLaVA with Docker Model Runner:
docker model run hf.co/remyxai/SpaceLLaVA:F16
- Lemonade
How to use remyxai/SpaceLLaVA with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull remyxai/SpaceLLaVA:F16
Run and chat with the model
lemonade run user.SpaceLLaVA-F16
List all available models
lemonade list
SpaceLLaVA
- Model Type: Multimodal, Vision-Language Model
- Architecture:
llava-v1.5-13b - Model Size: 13.4B parameters (FP16)
- Finetuned from: liuhaotian/llava-v1.5-13b
- Finetune Strategy: LoRA (Low-Rank Adaptation)
- License: Apache-2.0
Model Overview
SpaceLLaVA is a vision-language model adapted from LLaVA-1.5 (13B) and fine-tuned by LoRA to improve spatial reasoning. Trained using a synthetic VQA dataset inspired by the methods described in SpatialVLM. SpaceLLaVA demonstrates strong qualitative and quantitative spatial reasoning after distilling 3D scene understanding from the pipelines in VQASynth.
Running SpaceLLaVA
GGUF
Use this notebook to query spatial relationships between objects in a scene with llama-cpp-python.
Docker
docker build -f Dockerfile -t spacellava-server:latest
docker run -it --rm --gpus all -p8000:8000 -p8001:8001 -p8002:8002 --shm-size 12G spacellava-server:latest
python3 client.py --image_path "https://remyx.ai/assets/spatialvlm/warehouse_rgb.jpg" --prompt "What is the distance between the man in the red hat and the pallet of boxes?"
Dataset & Training
Dataset: SpaceLLaVA
Code: VQASynth
Reference: SpatialVLM
~28,000 synthetic samples created using templated VQA pairs with a 3D scene reconstruction pipeline
Formats: image (RGB), question (text), answer (text)
Spatial relation types include: βdistancesβ, βsizeβ, βleft ofβ, βaboveβ, βcloser toβ, βinsideβ
Scripts for LoRA SFT available at trl Check out the SpaceVLMs collection
Model Evaluation (Coming Soon)
TODO: VLMEvalKit evaluation on the QSpatial benchmark, VSR, etc.
Try it on Discord: http://discord.gg/b2yGuCNpuC
β οΈ Limitations & Ethical Considerations
- Performance may degrade in cluttered environments or camera perspective.
- This model was fine-tuned using synthetic reasoning over an internet image dataset.
- Multimodal biases inherent to the base model (LLaVA) may persist.
- Not intended for use in safety-critical or legal decision-making.
Users are encouraged to evaluate outputs critically and consider fine-tuning for domain-specific safety and performance.
License and Citation
Licensed under Apache-2.0.
@article{chen2024spatialvlm,
title = {SpatialVLM: Endowing Vision-Language Models with Spatial Reasoning Capabilities},
author = {Chen, Boyuan and Xu, Zhuo and Kirmani, Sean and Ichter, Brian and Driess, Danny and Florence, Pete and Sadigh, Dorsa and Guibas, Leonidas and Xia, Fei},
journal = {arXiv preprint arXiv:2401.12168},
year = {2024},
url = {https://arxiv.org/abs/2401.12168},
}
@misc{liu2023llava,
title={Visual Instruction Tuning},
author={Liu, Haotian and Li, Chunyuan and Wu, Qingyang and Lee, Yong Jae},
publisher={NeurIPS},
year={2023},
}
- Downloads last month
- 372
Model tree for remyxai/SpaceLLaVA
Base model
liuhaotian/llava-v1.5-13b
