Instructions to use sensenova/SenseNova-Loop-9B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sensenova/SenseNova-Loop-9B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sensenova/SenseNova-Loop-9B-Preview", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("sensenova/SenseNova-Loop-9B-Preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sensenova/SenseNova-Loop-9B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sensenova/SenseNova-Loop-9B-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sensenova/SenseNova-Loop-9B-Preview", "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/sensenova/SenseNova-Loop-9B-Preview
- SGLang
How to use sensenova/SenseNova-Loop-9B-Preview 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 "sensenova/SenseNova-Loop-9B-Preview" \ --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": "sensenova/SenseNova-Loop-9B-Preview", "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 "sensenova/SenseNova-Loop-9B-Preview" \ --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": "sensenova/SenseNova-Loop-9B-Preview", "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 sensenova/SenseNova-Loop-9B-Preview with Docker Model Runner:
docker model run hf.co/sensenova/SenseNova-Loop-9B-Preview
Single-file CMF build for local inference (Rust, GPU/CPU)
We packaged this model as single CMF files that run with cortiq, a Rust inference engine with no Python: the loop plan (layers 4β27 twice, each pass with its own cache), mHC with two residual streams and the Sinkhorn mix, the hybrid Gated DeltaNet / gated attention decoder, interleaved MRoPE and the vision tower, on Vulkan/DX12/Metal or CPU.
Files: https://huggingface.co/infosave/SenseNova-Loop-9B-Preview-cmf β q4tp (5.6 GB, wikitext-2 perplexity 13.20) and q8_2f (9.9 GB, 13.44; greedy text and an image description identical to Transformers float32).
On an NVIDIA A40 the q4tp file decodes 29 tok/s and reads a 2k-token prompt at 338 tok/s; on an Apple M4 (Metal) it decodes 11 tok/s.
cargo install cortiq-cli
cortiq run sensenova-loop-9b-q4tp.cmf --image photo.jpg --prompt "Describe this image." --no-think
(cortiq 0.8.51)