Instructions to use sensenova/SenseNova-Loop-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sensenova/SenseNova-Loop-9B 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", 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", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sensenova/SenseNova-Loop-9B 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" # 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", "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
- SGLang
How to use sensenova/SenseNova-Loop-9B 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" \ --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", "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" \ --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", "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 with Docker Model Runner:
docker model run hf.co/sensenova/SenseNova-Loop-9B
SenseNova-Loop-9B on cortiq (CMF): CUDA, Vulkan, Metal, CPU — a standard file and a Turbo file for long documents
SenseNova-Loop-9B now runs in cortiq, an open-source inference engine in Rust with no Python and no ML framework: NVIDIA cards through CUDA, NVIDIA, AMD and Intel GPUs through Vulkan, Apple silicon through Metal, and the CPU. The model comes as single CMF files in two versions, from cortiq 0.9.5 on.
cargo install cortiq-cli --features cuda # without --features cuda: Vulkan, DX12, Metal, CPU
hf download infosave/SenseNova-Loop-9B-cmf sensenova-loop-9b-q4tp.cmf --local-dir .
CMF_GPU=cuda cortiq run sensenova-loop-9b-q4tp.cmf --prompt "Write a Python function that merges two sorted lists." --greedy --no-think
1. Standard: infosave/SenseNova-Loop-9B-cmf, for chat, code and images. q4tp (5.7 GB, GPTQ calibrated over both visits of the loop) and q8_2f (10.2 GB). The files keep the loop (24 layers run twice), the two mHC streams, the vision encoder and the MTP head, whose drafts the card checks in one batch. Greedy text of q8_2f matches Transformers float32 on the reference prompts. Code, 256-token answers, the same text with drafts and without:
| with drafts, tok/s | without, tok/s | |
|---|---|---|
| RTX A5000, CUDA | 88.1 | 51.0 |
| RTX A5000, Vulkan | 57.5 | 49.3 |
| MacBook Air M4 (24 GB), Metal | 14.4 | 9.5 |
2. Turbo: infosave/SenseNova-Loop-9B-Turbo-cmf, for long documents. The same 4-bit weights plus a header that holds card memory in place: full-attention passes keep the first rows, the last rows and rows chosen as important exact, and the rest in a fixed far field. The loop makes this matter more, since each of its passes keeps its own keys and values.
| RTX A5000 | standard | turbo |
|---|---|---|
| CUDA, 128 000 tokens: card memory / decode | 16.5 GB / 30.5 tok/s | 8.3 GB / 49.9 tok/s |
| CUDA, 250 000 tokens | — | 8.3 GB / 50.4 tok/s |
| Vulkan, 128 000 tokens | 19.4 GB / 23.5 tok/s | 5.8 GB / 46.2 tok/s |
| facts planted in 60 000 / 120 000 / 240 000 characters | 4/4, 4/4, — | 4/4 at each |
Past the exact rows the turbo file's text is approximate: what lies far back fades. Short prompts (under 8192 tokens) run exact attention and the drafts, as in the standard file.
Two notes from the conversion, in case they help others: the MTP head ships in mtp.safetensors, outside model.safetensors.index.json, so tools that follow the index alone miss it; and YaRN applies at every length here, so in cortiq its cos/sin factor is folded into the q/k norms once at load.
The far field is the subject of U.S. patent application No. 19/738,763. Thanks for releasing the model and its looped design. Feedback is welcome.
Hi @infosave ,
I tested your inference engine cortiq with this particular model.
It was the first time I tested the engine and I did so on Windows, using the pre-built binary from cortiq-x86_64-pc-windows-msvc package. This was the latest version cortiq 0.9.17 at the time of writing this post.
Unfortunately, it seems like the output gives me either garbage by default or nothing at all when greedy parameter is used.
This is the output with greedy parameter:
cortiq run sensenova-loop-9b-q4tp.cmf --prompt "Write a Python function that merges two sorted lists." --greedy --no-think
Loading model: sensenova-loop-9b-q4tp.cmf
Ready: sensenova_loop | Task: general | Sparsity: 0%
Prompt: Write a Python function that merges two sorted lists.
←[2m2026-11-23T23:08:53.970464Z←[0m ←[33m WARN←[0m ←[2mcortiq_engine::gpu_wgpu←[0m←[2m:←[0m batch graph declined: all-layer live set exceeds the weight budget
←[2m2026-11-23T23:08:53.970612Z←[0m ←[33m WARN←[0m ←[2mcortiq_engine::pipeline←[0m←[2m:←[0m batched prefill Declined — per-position graph
[256 tokens · first token 16.1 s · decode 10.0 tok/s · overall 6.1 tok/s, finish: max_tokens]
[MTP draft: 0 of 54 accepted (0%)]
Hi @MrDevolver , thank you for testing it and for the log: the two warnings in it pointed straight at the cause.
Your card's weight budget holds only part of the model, so cortiq runs the first layers on the GPU and the rest on the CPU. SenseNova-Loop runs its layers 4–27 twice and carries two residual streams (mHC) through that loop. When the GPU/CPU boundary fell inside the loop, the CPU part continued from stale streams while the live ones stayed on the card: garbage after the first token, without --greedy and with it (there it came out as near-empty tokens, and 0 % of the drafts were accepted). I reproduced it by lowering the budget (CMF_GRAPH_LIVE_MB=4200 puts the boundary at layer 38 of 56): the same garbage.
The fix keeps the boundary out of the loop (at layer 28 of 56 in that case), and the answer then matches a run with the whole model on the GPU. It will be in the next cortiq release.
Until then, CMF_GPU=0 runs everything on the CPU and gives the right text, only slower. If you post your GPU and its memory (cortiq gpu prints the adapter and the weight budget), I'll check how much of the model that card can keep and how fast it should run.
@MrDevolver cortiq 0.9.18 is out with the fix: release page (cortiq-x86_64-pc-windows-msvc.zip), or cargo install cortiq-cli.
A correction to my note above: the boundary no longer moves. It stays where your card's memory puts it, and when it falls inside the loop, the CPU part now takes the two streams from the card and continues from them. So the card keeps as many layers as it can hold. With the budget lowered to put the boundary at layer 38 or 46 of 56, the answer is now the same as with the whole model on the GPU, with --greedy and without.
If you try it again, I'd be glad to see the output of cortiq gpu and the [... tokens · first token ... · decode ...] line.
@infosave thanks for response!
I downloaded the new version and I can confirm that I'm finally getting readable output (running the same command as shown before) and this is the output of it:
cortiq run sensenova-loop-9b-q4tp.cmf --prompt "Write a Python function that merges two sorted lists." --greedy --no-think
Loading model: sensenova-loop-9b-q4tp.cmf
Ready: sensenova_loop | Task: general | Sparsity: 0%
Prompt: Write a Python function that merges two sorted lists.
←[2m2026-11-24T18:40:33.866810Z←[0m ←[33m WARN←[0m ←[2mcortiq_engine::gpu_wgpu←[0m←[2m:←[0m batch graph declined: all-layer live set exceeds the weight budget
←[2m2026-11-24T18:40:33.867265Z←[0m ←[33m WARN←[0m ←[2mcortiq_engine::pipeline←[0m←[2m:←[0m batched prefill Declined — per-position graph
To merge two sorted lists into a single sorted list, we can use the two-pointer technique. This method efficiently combines the lists by comparing the smallest elements from each list and appending the smaller one to the result. Here's a step-by-step implementation:
1. Initialize pointers for both lists.
2. Compare the elements at the current pointers.
3. Append the smaller element to the result and move its pointer forward.
4. If one list is exhausted, append the remaining elements of the other list.
5. Return the merged list.
```python
def merge_sorted_lists(list1, list2):
"""
Merges two sorted lists into a single sorted list.
Args:
list1 (list): First sorted list.
list2 (list): Second sorted list.
Returns:
list: Merged sorted list.
"""
merged = []
i = j = 0
# Compare elements from both lists and append the smaller one
while i < len(list1) and j < len(list2):
if list1[i] <= list2[j]:
merged.append(list1[i])
i += 1
else
[256 tokens · first token 85.0 s · decode 9.5 tok/s · overall 2.3 tok/s, finish: max_tokens]
[MTP draft: 0 of 54 accepted (0%)]
As for the cortiq gpu output, here it is:
cortiq gpu
[0] Vulkan | Radeon RX Vega | DiscreteGpu | buffer up to 2.1 GB | workgroup 1024
[1] Dx12 | Radeon RX Vega | DiscreteGpu | buffer up to 2.1 GB | workgroup 1024
[2] Gl | Radeon RX Vega | Other | buffer up to 2.1 GB | workgroup 1024
[3] Dx12 | Microsoft Basic Render Driver | Cpu | buffer up to 2.1 GB | workgroup 1024
selected: Radeon RX Vega
←[2m2026-11-24T18:45:02.685213Z←[0m ←[32m INFO←[0m ←[2mcortiq_engine::gpu_wgpu←[0m←[2m:←[0m wgpu GPU path: on (Radeon RX Vega / Vulkan, discrete, weight budget 5360 MB, q1 8 rows/128 threads)
←[2m2026-11-24T18:45:02.749596Z←[0m ←[32m INFO←[0m ←[2mcortiq_engine::gpu_wgpu←[0m←[2m:←[0m pipeline cache: empty, will compile — if the process exits here without an error, the driver crashed in a shader compile: CMF_GPU_TRACE_PIPELINES=1 names the shader, CMF_GPU=0 runs on the CPU (C:\Users\User\AppData\Local\Temp\cortiq-pipelines-73302ac0ef47b7d7.bin)
round trip to the device: empty submit 0.67 ms · submit+dispatch+readback 0.15 ms
This is a dedicated Radeon RX Vega 56 GPU with 8GB of VRAM.
A note of observation:
I noticed the model took longer to load compared to previous version and somehow the overall speed reports a lower number than before, not sure why, but then again at least I am getting some output now, so I guess that's much better already. 😀
I do have a question though. I'm not much of a CLI guy. Normally I use GGUF models inside LM Studio or similar software which provide GUI that's comfortable for me to use. Unfortunately, the lack of support in official llama.cpp engine pushed me into looking for alternatives. Since it is working in your inference engine, I'd like to ask if there is a simple way for me to hook this inference into some kind of UI / agent with GUI that I could work with in a way that I'm familiar with and if so, how can I do that? Thanks in advance!
Update:
In the meantime I found out "serve" option so I used that to start up a server instead of loading the model to respond to a single prompt. I was able to hook it into kobold lite UI for quick testing and some requests it handled pretty well, but when I tried something which I assume was something harder, the engine crashed with the following error:
←[2m2026-11-24T22:53:14.938826Z←[0m ←[31mERROR←[0m ←[2mwgpu::backend::wgpu_core←[0m←[2m:←[0m Handling wgpu errors as fatal by default
thread 'tokio-rt-worker' (19596) panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\wgpu-30.0.0\src\backend\wgpu_core.rs:1619:18:
wgpu error: Out of Memory
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
←[2m2026-11-24T22:53:15.933091Z←[0m ←[31mERROR←[0m ←[2mcortiq_server::openai←[0m←[2m:←[0m generation task panicked: task 53 panicked with message "wgpu error: Out of Memory\n"
I'm not sure what does this mean or how to deal with this, but I noticed the use of VRAM doubled out of sudden and I believe the RAM raised up a little bit as well. To prevent confusion, maybe let me clarify that the first time the model loaded, the VRAM and RAM usage was pretty modest overall, only maybe 5.2 - 5.3 GB used for VRAM out of 8 GB which was suspicious, since usually that's not the case with GGUF models in llama.cpp engine where I would see full VRAM use, but I went with it because everything seemed fine until that last harder task during which the engine crashed. I guess there are still some technical issues to be ironed out, so I'm looking forward for any updates that may help in that regard.
@MrDevolver thank you for testing it again, and for the details: they explained all three things. cortiq 0.9.20 is out with fixes: release page (cortiq-x86_64-pc-windows-msvc.zip), or cargo install cortiq-cli.
Your card's weight budget (5360 MB of the 8 GB) holds 49 of the model's 56 layer passes; the CPU runs the rest. That is behind all three:
- Drafts, "0 of 54". Checking drafts takes the whole model in one batch on the GPU, which does not fit, so every check was refused after the drafts had been made. In 0.9.20 the first refusal turns the drafts off for the model, so no time goes into them.
- The 85 s first token was mostly the first run of a new version compiling its shaders into an empty cache (the "pipeline cache: empty, will compile" line); later runs reuse the cache. With part of the model on the CPU, a prompt is still read one token at a time, at about the decode speed, so a long prompt takes a while.
- The crash in
serve. The GPU copy of the conversation's keys and values grew in doublings, and on a long chat the next doubling did not fit next to the weights. In 0.9.20 it grows in small blocks, and if the card still runs out of memory, that request ends with an error and the server keeps running, on the CPU from then on. To keep long chats on the GPU, leave the cache more room by keeping fewer layers on the card, at some cost in speed:set CMF_GRAPH_LIVE_MB=4500(cmd) or$env:CMF_GRAPH_LIVE_MB=4500(PowerShell) beforecortiq serve.
On a GUI: cortiq serve speaks the OpenAI API, so any app that takes an OpenAI-compatible endpoint works, such as Open WebUI, Jan, AnythingLLM, SillyTavern, or the Kobold Lite you found: base URL http://127.0.0.1:8080/v1, any API key. Opening http://127.0.0.1:8080/ in a browser shows cortiq's own web dashboard. LM Studio itself does not load CMF files.
