Skip to content

Quickstart

Select the engine, version and environment below to display its complete integration guide. The standard engine image and the UCM image use the same environment selection. Release identifies the installation artifact version.

Loading the current release manifest...

vLLM (CUDA)

Environment and prerequisites

Prepare two available devices for --tensor-parallel-size 2 and a matching host driver. Place the Qwen/Qwen2.5-14B-Instruct model files in <path_to_your_models> on the host and prepare a writable <path_to_your_storage> cache directory. Both images mount these at /workspace/model and /workspace/storage, with /workspace as the working directory.

Choose an image

Start the standard vLLM image

Run these commands on the host. The standard engine image matches the environment selected above and does not yet include UCM.

No matching standard image and UCM Wheel can be determined for this environment. Use a source build.

Start the UCM image

Run these commands on the host. This image builds on the same standard engine image and already includes UCM. After entering the container, continue directly with the configuration below.

The release data does not identify a UCM image for this environment. Use a source build.

After entering either container, complete the same configuration and startup steps below inside that container. Send verification requests from another host terminal.

For storage changes, see Cache Configuration; field definitions are in Configuration Parameters.

Configure the cache

Create a writable /workspace/storage directory, mounted persistently if running in a container. Save the following as /workspace/ucm_config_example.yaml, readable by the engine:

mkdir -p /workspace/storage
cat > /workspace/ucm_config_example.yaml <<'YAML'
ucm_connectors:
  - ucm_connector_name: UcmPipelineStore
    ucm_connector_config:
      store_pipeline: "Cache|Posix"
      storage_backends: /workspace/storage
      posix_capacity_gb: 10240
      posix_io_engine: "psync"
      posix_data_trans_concurrency: 128
enable_metrics: true
YAML

The Cache and Posix settings follow the repository example, with the storage path matched to the container mount. Host cache capacity is not overridden; see the effective defaults in Configuration parameters. enable_metrics: true supports the metrics check below.

Start the server

The example loads the Qwen2.5-14B-Instruct model mounted at /workspace/model. The request uses the same model path as the server. When changing models, also review parallelism, context length and model-specific parameters.

export MODEL_ID=/workspace/model
export ENABLE_UCM_PATCH=1
vllm serve "$MODEL_ID" \
  --tensor-parallel-size 2 \
  --max-model-len 20000 \
  --gpu-memory-utilization 0.87 \
  --trust-remote-code \
  --block-size 128 \
  --port 7800 \
  --enforce-eager \
  --kv-transfer-config '{
    "kv_connector": "UCMConnector",
    "kv_connector_module_path": "ucm.integration.vllm.ucm_connector",
    "kv_role": "kv_both",
    "kv_connector_extra_config": {"UCM_CONFIG_FILE": "/workspace/ucm_config_example.yaml"}
  }'

The runtime patch hook and connector are both required. Confirm the startup log contains create UcmPipelineStore with config: and the expected storage path.

Verify the service and external cache

A ready HTTP server confirms service startup; it does not prove a UCM cache hit.

curl --fail http://127.0.0.1:7800/health
curl --fail http://127.0.0.1:7800/v1/models

In another host terminal, generate a repeatable prompt longer than several 128-token blocks, then send it:

python3 - <<'PYREQUEST'
import json
from pathlib import Path
Path('/tmp/ucm-request.json').write_text(json.dumps({
    "model": "/workspace/model",
    "prompt": "Explain how a shared external cache reuses previous computation. " * 128,
    "max_tokens": 100,
    "temperature": 0,
}))
PYREQUEST
curl --fail http://127.0.0.1:7800/v1/completions \
  -H 'Content-Type: application/json' --data-binary @/tmp/ucm-request.json
curl --fail http://127.0.0.1:7800/metrics | grep '^ucm:'

Wait for saves to complete, retain the test cache, restart with the same settings and replay the request. Check external hits, completed loads and correct output using external-cache verification.

For missing hits or failed loads, check configuration, storage and memory budgets through troubleshooting.

Use other models

Keep model-specific engine settings from Model Tour, then add the UCM Connector configuration above.

vLLM-Ascend (NPU)

Environment and prerequisites

Prepare two available devices for --tensor-parallel-size 2 and a matching host driver. Place the Qwen/Qwen2.5-14B-Instruct model files in <path_to_your_models> on the host and prepare a writable <path_to_your_storage> cache directory. Both images mount these at /workspace/model and /workspace/storage, with /workspace as the working directory.

Choose an image

Start the standard vLLM-Ascend image

Run these commands on the host. The standard engine image matches the environment selected above and does not yet include UCM.

No matching standard image and UCM Wheel can be determined for this environment. Use a source build.

Start the UCM image

Run these commands on the host. This image builds on the same standard engine image and already includes UCM. After entering the container, continue directly with the configuration below.

The release data does not identify a UCM image for this environment. Use a source build.

After entering either container, complete the same configuration and startup steps below inside that container. Send verification requests from another host terminal.

For storage changes, see Cache Configuration; field definitions are in Configuration Parameters.

Configure the cache

Create a writable /workspace/storage directory, mounted persistently if running in a container. Save the following as /workspace/ucm_config_example.yaml, readable by the engine:

mkdir -p /workspace/storage
cat > /workspace/ucm_config_example.yaml <<'YAML'
ucm_connectors:
  - ucm_connector_name: UcmPipelineStore
    ucm_connector_config:
      store_pipeline: "Cache|Posix"
      storage_backends: /workspace/storage
      posix_capacity_gb: 10240
      posix_io_engine: "psync"
      posix_data_trans_concurrency: 128
enable_metrics: true
YAML

The Cache and Posix settings follow the repository example, with the storage path matched to the container mount. Host cache capacity is not overridden; see the effective defaults in Configuration parameters. enable_metrics: true supports the metrics check below.

Start the server

The example loads the Qwen2.5-14B-Instruct model mounted at /workspace/model. The request uses the same model path as the server. When changing models, also review parallelism, context length and model-specific parameters.

export MODEL_ID=/workspace/model
export ENABLE_UCM_PATCH=1
vllm serve "$MODEL_ID" \
  --tensor-parallel-size 2 \
  --max-model-len 20000 \
  --gpu-memory-utilization 0.87 \
  --trust-remote-code \
  --block-size 128 \
  --port 7800 \
  --enforce-eager \
  --kv-transfer-config '{
    "kv_connector": "UCMConnector",
    "kv_connector_module_path": "ucm.integration.vllm.ucm_connector",
    "kv_role": "kv_both",
    "kv_connector_extra_config": {"UCM_CONFIG_FILE": "/workspace/ucm_config_example.yaml"}
  }'

The runtime patch hook and connector are both required. Confirm the startup log contains create UcmPipelineStore with config: and the expected storage path.

Verify the service and external cache

A ready HTTP server confirms service startup; it does not prove a UCM cache hit.

curl --fail http://127.0.0.1:7800/health
curl --fail http://127.0.0.1:7800/v1/models

In another host terminal, generate a repeatable prompt longer than several 128-token blocks, then send it:

python3 - <<'PYREQUEST'
import json
from pathlib import Path
Path('/tmp/ucm-request.json').write_text(json.dumps({
    "model": "/workspace/model",
    "prompt": "Explain how a shared external cache reuses previous computation. " * 128,
    "max_tokens": 100,
    "temperature": 0,
}))
PYREQUEST
curl --fail http://127.0.0.1:7800/v1/completions \
  -H 'Content-Type: application/json' --data-binary @/tmp/ucm-request.json
curl --fail http://127.0.0.1:7800/metrics | grep '^ucm:'

Wait for saves to complete, retain the test cache, restart with the same settings and replay the request. Check external hits, completed loads and correct output using external-cache verification.

For missing hits or failed loads, check configuration, storage and memory budgets through troubleshooting.

Use other models

Keep model-specific engine settings from Model Tour, then add the UCM Connector configuration above.

SGLang

Environment and prerequisites

Prepare two available devices for --tensor-parallel-size 2 and a matching host driver. Place the Qwen/Qwen2.5-14B-Instruct model files in <path_to_your_models> on the host and prepare a writable <path_to_your_storage> cache directory. Both images mount these at /workspace/model and /workspace/storage, with /workspace as the working directory.

Choose an image

Start the standard SGLang image

Run these commands on the host. The standard SGLang image matches the environment selected above and does not yet include UCM.

Start the UCM image

Run these commands on the host. This image builds on the same standard SGLang image and already includes UCM. After entering the container, continue directly with the configuration below.

Configure HiCache

Create a writable, persistent /workspace/storage directory. The adapter requires page_first host layout and interface_v1; do not change them to the older copy-based storage API.

Create /workspace/ucm_config.yaml inside the container, using the same YAML format as vLLM and configuring exactly one Store:

ucm_connectors:
  - ucm_connector_name: UcmPipelineStore
    ucm_connector_config:
      store_pipeline: Posix
      storage_backends: /workspace/storage
      posix_io_engine: psync

Select this file through kv_connector_extra_config.UCM_CONFIG_FILE:

export MODEL_ID=/workspace/model
HICACHE_CONFIG='{
  "backend_name": "unifiedcache",
  "module_path": "ucm.integration.sglang.unifiedcache_store",
  "class_name": "UnifiedCacheStore",
  "interface_v1": 1,
  "kv_connector_extra_config": {
    "UCM_CONFIG_FILE": "/workspace/ucm_config.yaml"
  }
}'

Start the server

The example loads the Qwen2.5-14B-Instruct model mounted at /workspace/model. The request uses the same model path as the server. When changing models, also review parallelism, context length and model-specific parameters.

python3 -m sglang.launch_server \
  --model-path "$MODEL_ID" \
  --tensor-parallel-size 2 \
  --page-size 128 \
  --trust-remote-code \
  --port 7800 \
  --enable-hierarchical-cache \
  --hicache-mem-layout page_first \
  --hicache-write-policy write_through \
  --hicache-storage-backend dynamic \
  --hicache-storage-prefetch-policy wait_complete \
  --hicache-storage-backend-extra-config "$HICACHE_CONFIG"

Adjust the model and parallelism to the available GPUs. The adapter supplies block geometry; UCM storage settings are read from the YAML file above. HiCache defaults to Posix when store_pipeline is omitted. Other configured pipelines are passed to the Store unchanged, with a warning that incompatibility may cause startup to fail.

Verify the service and external cache

The health and model endpoints confirm that the SGLang service is ready; they do not prove that an external cache read occurred.

curl --fail http://127.0.0.1:7800/health
curl --fail http://127.0.0.1:7800/v1/models

In another host terminal, send a repeatable request with a prompt longer than several 128-token blocks:

python3 - <<'PYREQUEST'
import json
import os
from pathlib import Path
Path('/tmp/ucm-request.json').write_text(json.dumps({
    "model": os.environ["MODEL_ID"],
    "prompt": "Explain how a shared external cache reuses previous computation. " * 128,
    "max_tokens": 64,
    "temperature": 0,
}))
PYREQUEST
curl --fail http://127.0.0.1:7800/v1/completions \
  -H 'Content-Type: application/json' --data-binary @/tmp/ucm-request.json

Wait for the write to complete, stop the server, retain the cache directory, and restart with the same model, page size and parallelism. Replay the request and confirm HiCache reports a storage-prefetched load. See Troubleshooting if no external read is reported.