Run this model with HF Jobs
Run ambient-intelligence-labs/tempora-1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/ambient-intelligence-labs/tempora-1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ambient-intelligence-labs/tempora-1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/ambient-intelligence-labs/tempora-1. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/ambient-intelligence-labs/tempora-1. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use ambient-intelligence-labs/tempora-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ambient-intelligence-labs/tempora-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ambient-intelligence-labs/tempora-1") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ambient-intelligence-labs/tempora-1") model = AutoModelForMultimodalLM.from_pretrained("ambient-intelligence-labs/tempora-1", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ambient-intelligence-labs/tempora-1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ambient-intelligence-labs/tempora-1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ambient-intelligence-labs/tempora-1", "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/ambient-intelligence-labs/tempora-1
- SGLang
How to use ambient-intelligence-labs/tempora-1 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 "ambient-intelligence-labs/tempora-1" \ --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": "ambient-intelligence-labs/tempora-1", "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 "ambient-intelligence-labs/tempora-1" \ --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": "ambient-intelligence-labs/tempora-1", "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 ambient-intelligence-labs/tempora-1 with Docker Model Runner:
docker model run hf.co/ambient-intelligence-labs/tempora-1
Tempora-1
A temporal video segmentation model for general video and robotics. Give it a video and a plain-language instruction that says what counts as a segment; it returns the matching events in order as JSON, each with a start time, an end time, a short label and any metadata fields you ask for. This repo keeps its first name (tempora-27b); the model is Tempora-1.
Each model's best run on WGO-Bench:
Full result:
All rows, per-source scores and how each number is produced: results/wgo/RESULTS.md.
Serving with vLLM
Start the server:
docker run --gpus all --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e HF_TOKEN \
-e VLLM_MAX_MEDIA_REQUEST_DECODE_BYTES=8000000000 \
vllm/vllm-openai:v0.33.0 \
ambient-intelligence-labs/tempora-1 \
--served-model-name tempora-1 \
--max-num-batched-tokens 65536 \
--limit-mm-per-prompt '{"image": 0, "video": 1}' \
--trust-request-mm-kwargs \
--reasoning-parser qwen3
Send a video (a 2-minute archival basketball newsreel; the server downloads it):
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "tempora-1",
"temperature": 0,
"chat_template_kwargs": {"enable_thinking": true},
"media_io_kwargs": {"video": {"fps": 3.0008, "backend": "torchcodec"}},
"mm_processor_kwargs": {"do_sample_frames": false,
"size": {"shortest_edge": 25296896, "longest_edge": 44269568}},
"messages": [{"role": "user", "content": [
{"type": "video_url", "video_url": {"url": "https://goambient.ai/assets/blog/video-chunker/ncaa_1963.mp4"}},
{"type": "text", "text": "Instruction: Segment only the parts where gameplay is not shown: only the audience or cheerleaders are on screen.\nmetadata_fields: [\"description\"]\nReturn JSON: {\"chunks\":[{\"start\":sec,\"end\":sec,\"label\":...}]}"}
]}]
}'
The answer is in choices[0].message.content as {"chunks": [{"start", "end", "label", "metadata"}]}; the reasoning,
with thinking on, is in reasoning_content. Put your own instruction in the text: Instruction: says what counts as
a segment, Task: (optional) what the person or robot is doing, and metadata_fields the fields to fill per segment.
Video settings: compute them for each video
fps, shortest_edge and longest_edge in the request above are for this 128.8-second video. They make the
server show the model its best configuration : 3 frames per second, at most 540 frames, and 64 to 112 visual
tokens (65,536 to 114,688 pixels) per frame. For another video:
n= 3 ร duration in seconds, at most 540, rounded down to an even number (If your hardware/setup supports >540, go for it)fps= (n + 0.5) / duration (the 0.5 makes the server keep exactlynframes)shortest_edge= 65536 ร n andlongest_edge= 114688 ร n (pixel limits for the whole clip)
Don't reuse these values on a longer video, and don't leave out
size. Too few pixels get spread over too many frames: the model can't read on-screen text and guesses names and labels.
This snippet computes them from the video and sends the same request:
VIDEO=https://goambient.ai/assets/blog/video-chunker/ncaa_1963.mp4
MAX_FRAMES=540 # frame cap; raise it only if your server limits allow (see below)
read FPS SMIN SMAX < <(ffprobe -v error -show_entries format=duration -of csv=p=0 "$VIDEO" | MAX_FRAMES=$MAX_FRAMES python3 -c '
import os, sys; d = float(sys.stdin.read()); n = int(min(max(3 * d, 4), int(os.environ["MAX_FRAMES"]))) // 2 * 2
print(f"{(n + 0.5) / d:.4f}", 65536 * n, 114688 * n)')
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d @- <<EOF
{
"model": "tempora-1",
"temperature": 0,
"max_tokens": 32768,
"chat_template_kwargs": {"enable_thinking": true},
"media_io_kwargs": {"video": {"fps": $FPS, "backend": "torchcodec"}},
"mm_processor_kwargs": {"do_sample_frames": false,
"size": {"shortest_edge": $SMIN, "longest_edge": $SMAX}},
"messages": [{"role": "user", "content": [
{"type": "video_url", "video_url": {"url": "$VIDEO"}},
{"type": "text", "text": "Instruction: Segment only the parts where gameplay is not shown: only the audience or cheerleaders are on screen.\nmetadata_fields: [\"description\"]\nReturn JSON: {\"chunks\":[{\"start\":sec,\"end\":sec,\"label\":...}]}"}
]}]
}
EOF
Values for common lengths:
| Video length | n |
fps |
shortest_edge |
longest_edge |
|---|---|---|---|---|
| 30 s | 90 | 3.0167 | 5,898,240 | 10,321,920 |
| 60 s | 180 | 3.0083 | 11,796,480 | 20,643,840 |
| 2 min | 360 | 3.0042 | 23,592,960 | 41,287,680 |
| 3 min or longer | 540 | 540.5 / seconds | 35,389,440 | 61,931,520 |
The Python client below does this for you.
Server flags
--max-num-batched-tokens 65536also sets the vision cache; it fits 540-1024 frames. A request that fails with "exceeds the pre-allocated encoder cache size" needs a larger value (the default is 12,288).VLLM_MAX_MEDIA_REQUEST_DECODE_BYTES: 540 decoded 1080p frames are about 3.4 GB; the default limit is about 0.7 GB.--trust-request-mm-kwargslets each request carry its video settings. It also lets any caller change them, so set--api-keyon a server others can reach.
More frames for long videos. The model's default is 540 frames, so videos longer than 3 minutes are
sampled below 3 fps (16 minutes: 0.55 fps) and short events can fall between frames. If your GPU has room, raise
MAX_FRAMES and the server limits together. For longer videos, higher frames should give improved results.
| Frame cap | --max-num-batched-tokens |
VLLM_MAX_MEDIA_REQUEST_DECODE_BYTES |
|---|---|---|
| 540 (trained) | 32768 | 4000000000 |
| 1080 | 65536 | 8000000000 |
| 2160 | 131072 | 16000000000 |
On WGO-Bench the vLLM server scores 0.47 to 0.49 seg F1 against 0.51 offline; use offline inference for benchmark numbers.
Serving with SGLang
docker run --gpus all --ipc=host -p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e HF_TOKEN \
lmsysorg/sglang:v0.5.23 \
python3 -m sglang.launch_server \
--model-path ambient-intelligence-labs/tempora-1 \
--host 0.0.0.0 --port 30000 \
--served-model-name tempora-1 \
--context-length 65536 \
--reasoning-parser qwen3 \
--limit-mm-data-per-request '{"video": 1}' \
--mem-fraction-static 0.7 \
--mm-process-config '{
"video": {
"fps": 3, "min_frames": 4, "max_frames": 540,
"min_pixels": 65536, "max_pixels": 114688,
"size": {"shortest_edge": 4096, "longest_edge": 61931520}
}
}'
SGLang sets the video settings once for the whole server, so requests are the first curl above sent to port 30000
without media_io_kwargs and mm_processor_kwargs. In --mm-process-config:
fps,min_frames,max_frames: 3 frames per second, at least 4 and at most 540 frames.min_pixels,max_pixels: 64 to 112 visual tokens per frame.size: a cap on the whole clip (114688 ร 540) with a near-zero floor, so the per-frame limits apply at every length. To allow more frames, raisemax_frames, setlongest_edgeto 114688 รmax_frames, and raise--context-length.
SGLang cannot match the training frame sampling exactly (0.48 seg F1 on WGO-Bench). Keep concurrency at 2 for long HD video.
Python API
Install the package from the GitHub repo. It applies the frame sampling and prompt format the model was trained with; other frame rates or resolutions shift its timestamps.
git clone https://github.com/ambient-intelligence-hq/tempora-1 && cd tempora-1
pip install -e ".[infer]" # offline inference with vLLM (one GPU with >= 80 GB)
pip install -e ".[client]" # only talk to a running vLLM / SGLang server
Usage:
from video_chunker import VideoChunker
if __name__ == "__main__": # vLLM starts its engine in a new process; keep the guard
vc = VideoChunker() # ambient-intelligence-labs/tempora-1, thinking on
res = vc.chunk("talk.mp4",
instruction="Segment by the talk sections",
fields=["person_speaking", "slide_title"])
for c in res.chunks:
print(f"{c.start:7.1f} {c.end:7.1f} {c.label} {c.metadata}")
Command line:
video-chunker robot.mp4 --instruction "Separate segments for picking up and for placing each object." \
--task "put the cups in the sink" --no-thinking --out chunks.json
vLLM:
from video_chunker.client import ChunkerClient
res = ChunkerClient("http://localhost:8000/v1").chunk("talk.mp4", instruction="Segment by the talk sections")
SGLang:
from video_chunker.client import ChunkerClient
res = ChunkerClient("http://localhost:30000/v1", server="sglang").chunk("talk.mp4", instruction="Segment by the talk sections")
Details: docs/serving.md.
Writing instructions
- Instruction: what counts as one chunk, in your own words ("one segment per slide", "the steps of the procedure").
- Task (optional): what the person or robot is trying to do.
- Fields (optional): names of metadata fields to fill for every chunk, with optional descriptions.
- Thinking is on by default and improves boundaries on long first-person video, at about 2.5 times the generation time. Turn it off for throughput.
- Videos up to 3 minutes are seen at the full 3 frames per second (540 frames); longer videos are sampled more sparsely.
- Downloads last month
- 136
Model tree for ambient-intelligence-labs/tempora-1
Spaces using ambient-intelligence-labs/tempora-1 2
Evaluation results
- Seg F1 (tIoU 0.75) on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.510
- E2E F1 on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.325
- Label acc. on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.640
- Seg F1 (tIoU 0.75) on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.476
- E2E F1 on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.299
- Label acc. on WGO-Bench (100 episodes)test set Tempora-1 WGO-Bench results (mean of 3 runs)0.630


