Instructions to use openvla/openvla-7b-finetuned-libero-spatial with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openvla/openvla-7b-finetuned-libero-spatial with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="openvla/openvla-7b-finetuned-libero-spatial", trust_remote_code=True)# Load model directly from transformers import AutoModelForVision2Seq model = AutoModelForVision2Seq.from_pretrained("openvla/openvla-7b-finetuned-libero-spatial", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openvla/openvla-7b-finetuned-libero-spatial with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openvla/openvla-7b-finetuned-libero-spatial" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openvla/openvla-7b-finetuned-libero-spatial", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openvla/openvla-7b-finetuned-libero-spatial
- SGLang
How to use openvla/openvla-7b-finetuned-libero-spatial 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 "openvla/openvla-7b-finetuned-libero-spatial" \ --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": "openvla/openvla-7b-finetuned-libero-spatial", "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 "openvla/openvla-7b-finetuned-libero-spatial" \ --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": "openvla/openvla-7b-finetuned-libero-spatial", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openvla/openvla-7b-finetuned-libero-spatial with Docker Model Runner:
docker model run hf.co/openvla/openvla-7b-finetuned-libero-spatial
Silent vision bypass on transformers ≥4.50: constant action for every image (fix inside)
On a current stack (transformers 4.56.2, torch 2.10), predict_action on this checkpoint returns a plausible but input-independent action — the same 7 tokens (31872 ×7 → [0.096, 0.1071, -0.0027, -0.0016, -0.015, -0.0193, 0.0]) for a real frame, a pure black image, a pure white image and random noise. vision_backbone and projector forward hooks fire 0 times. No error is raised, so it looks like a working policy.
Cause (in modeling_prismatic.py): prepare_inputs_for_generation slices the prompt whenever past_key_values is not None. transformers ≥4.50 passes an empty DynamicCache on step 0 instead of None, so the 35-token prompt collapses to 1 token, forward routes into its input_ids.shape[1] == 1 cached-generation branch, and pixel_values is never consumed.
Fix: gate the slice on actual cache length and forward an empty cache as None (the multimodal branch asserts past_key_values is None). Two smaller modern-stack blockers: _supports_sdpa declared as a property (evaluated before language_model exists) and GenerationMixin no longer auto-inherited.
Full write-up with the verification on the official AutoModelForVision2Seq load path, and the patched function: https://github.com/openvla/openvla/issues/346
A drop-in shim that applies the fixes without changing the weights, plus a one-command black-vs-white check (openvla-compat-check): https://github.com/jashshah999/vla-lite — also runs the model in nf4 at 4.6 GB VRAM.
Suggested regression test for the remote code: a black frame and a white frame must not yield the same action. Happy to open a PR here if that's preferred.