Skip to main content

Deploy with the SGLang image

Build one Docker image with the SGLang runtime and the Valen plugin, then serve Valen over HTTP from one GPU.

The image builds on the official SGLang 0.5.23 runtime (lmsysorg/sglang:v0.5.23) and contains the serving runtime; model weights download on first startup. To install the plugin into an existing SGLang environment instead, see plugin deployment.

Before you start
  • Linux x86-64 with an NVIDIA GPU that supports FA3 and a compatible CUDA driver.
  • Docker with Buildx and NVIDIA Container Toolkit.
  • The Valen source to build the image.

Build the image​

Build valen-sglang:0.1.0-dev3 from the root of the Valen repository:

Terminal
docker buildx build --platform linux/amd64 --load \
-t valen-sglang:0.1.0-dev3 \
-f serving/sglang/docker/Dockerfile .

Start the server​

Start the container and wait for the model to load. The example mounts the Hugging Face cache on the host so later launches can reuse the weights.

Terminal
docker run --rm --gpus device=0 --ipc=host \
-p 127.0.0.1:30000:30000 \
-v "$HOME/.cache/huggingface:/root/.cache/huggingface" \
valen-sglang:0.1.0-dev3 \
--model-path Valen-Team/Valen-Decision-1.5-2B \
--served-model-name valen \
--dtype bfloat16 \
--host 0.0.0.0 --port 30000
SettingExample defaultPurpose
--model-pathValen-Team/Valen-Decision-1.5-2BHub model name or complete checkpoint directory
--served-model-namevalenModel name sent in requests
--dtypebfloat16Load the backbone in BF16, the precision the released weights run in. Without it the backbone can load in FP32 and take twice the GPU memory; Valen-Decision-1.5-27B has about 54 GB of weights in BF16
Port mapping127.0.0.1:30000:30000Access from the local host

Send a request​

Send a text request using SystemOne or Decisions:

ProtocolRequest structurePredicate probability in the example
SystemOnestate + questions keyed by IDanswers.on_sofa.noul
Decisionsinput + question listanswers[0].probability

The request model must match the configured served model name. temperature defaults to 1.0 and must be a finite number greater than zero.

Terminal
curl http://127.0.0.1:30000/v1/decisions \
-H 'Content-Type: application/json' \
-d '{
"model": "valen",
"input": "A cat is on the sofa.",
"questions": [
{
"name": "on_sofa",
"type": "predicate",
"instructions": "The cat is on the sofa."
}
],
"temperature": 1
}'

Send an image request​

Run python -m pip install requests in the client environment and replace cat.jpg with a local PNG, JPEG, or WebP image. The Python example reads the file, infers its MIME type from the filename, and encodes it as a data URL.

SystemOne uses image_url content blocks in state.messages; Decisions uses input_image content blocks in input. Both examples send the model name valen.

Python
import base64
import mimetypes
from pathlib import Path

import requests

image_path = Path("cat.jpg")
mime_type = mimetypes.guess_type(image_path.name)[0]
image_b64 = base64.b64encode(image_path.read_bytes()).decode("ascii")
image_url = f"data:{mime_type};base64,{image_b64}"

response = requests.post(
"http://127.0.0.1:30000/v1/decisions",
json={
"model": "valen",
"input": [
{
"role": "user",
"content": [
{
"type": "input_image",
"image_url": image_url
},
{
"type": "input_text",
"text": "Inspect this image."
}
]
}
],
"questions": [
{
"name": "animal",
"type": "choice",
"instructions": "Which animal is visible?",
"choices": [
{
"value": "cat",
"description": "A cat"
},
{
"value": "dog",
"description": "A dog"
}
]
}
],
"temperature": 1
},
timeout=120,
)
response.raise_for_status()
print(response.json()["answers"])

Supported scope​

  • Checkpoints: full Valen Qwen3.5 Mixer checkpoints with shared_state execution, on one GPU with TP=PP=1.
  • Questions: predicate, choice and score over text and images. Choice takes 1–255 candidates; score takes 2–255 ordered levels. Valen-Decision-1.5 checkpoints also answer bbox questions, which locate a described object in one input image.
  • Video: extract frames and submit them as image inputs.
  • Agreement with the native model: on Valen-Decision-1.5 0.8B and 2B, served answers match the native model within 0.02.

See SystemOne and Decisions for question and answer structures.

Next steps​