Simulation
Backend API
Local and Pod execution share request progress reporting through llm_d_lens.simulation.progress.report_request_progress. Pod reporting still waits for readiness; local reporting retains its original start time. Backend adapters share artifact error formatting through backends.analytics.artifact_error_message, while retaining their own error/timeout field precedence, status mapping, and metric units. Task APIs and backend environment preparation are unchanged.
Simulation routes live in llm_d_lens/simulation/router.py under the /api/simulation prefix.
List simulation backends
List Simulation backends Lens knows about and whether each backend is available in the current environment.
- REST API
- Python API
GET /api/simulation/backends
Request: no body.
Response:
{
"backends": [
{
"name": "aiperf",
"display_name": "AIPerf",
"api_version": 1,
"available": true,
"version": "0.12.0",
"unavailable_reason": null,
"scenarios": [
{
"name": "chat",
"display_name": "Chat",
"description": "Conversational and general assistant traffic.",
"supported_backends": []
},
{
"name": "api-calling",
"display_name": "Tool & API Use",
"description": "Tool-use, agent, and business API traffic.",
"supported_backends": []
}
],
"capabilities": {
"prompt_kinds": ["trace"],
"arrival_patterns": [],
"supports_duration": true,
"supports_request_count": false,
"supports_request_rate": false,
"supports_streaming": true,
"supports_per_request_results": true,
"supports_cancellation": true,
"supports_trace_range": true,
"scale_factor_trace_formats": ["baseten_trace"],
"trace_format_capabilities": {
"mooncake_trace": {"supports_trace_range": true, "supports_scale_factor": false}
},
"advanced_options": [],
"trace_formats": [
"mooncake_trace",
"bailian_trace",
"baseten_trace",
"burst_gpt_trace",
"weka_public_dataset"
]
},
"managed_installation": false
}
]
}
from llm_d_lens.simulation.backends import list_backends
for backend in list_backends():
print(backend.name, backend.available, backend.version)
Discover endpoint models
Probe a model endpoint and discover which models it reports. The optional api_key is sent as a Bearer token and is not included in the response. Failed connectivity, authentication, or invalid model lists return HTTP 400.
- REST API
- Python API
POST /api/simulation/models/discover
Request body: ModelDiscoveryRequest
endpoint_url(string, required)api_key(string, optional, maximum 4096 characters; used only for this request)
{
"endpoint_url": "http://127.0.0.1:38000/v1"
}
Response:
{
"endpoint": "http://127.0.0.1:38000/v1",
"models": [
"Qwen/Qwen3-8B",
"Qwen/Qwen3-8B-Instruct"
]
}
import asyncio
from llm_d_lens.simulation.endpoints import discover_models
async def main() -> None:
models = await discover_models("http://127.0.0.1:38000/v1", api_key="your-model-access-token")
print(models["endpoint"], models["models"])
asyncio.run(main())
List simulation scenarios
List the simulation scenario catalog Lens exposes, such as chat, API-calling, and coding.
- REST API
- Python API
GET /api/simulation/scenarios
Request: no body.
Response:
{
"scenarios": [
{
"name": "chat",
"display_name": "Chat",
"description": "Conversational and general assistant traffic.",
"supported_backends": ["aiperf", "trace-replayer"]
},
{
"name": "coding",
"display_name": "Code Generation",
"description": "Code generation and software engineering traffic.",
"supported_backends": ["aiperf"]
}
]
}
from llm_d_lens.simulation.backends import list_scenarios
for scenario in list_scenarios():
print(scenario.name, scenario.supported_backends)
List trace datasets
List registered trace datasets and the backends that can replay each one.
- REST API
- Python API
GET /api/simulation/trace-datasets
Request: no body.
Response:
{
"data_dir": "/home/prism/.local/share/prism/data/datasets",
"datasets": [
{
"name": "mooncake-arxiv",
"filename": "mooncake_trace.jsonl",
"scenario": "chat",
"trace_format": "mooncake_trace",
"description": "Mooncake chat trace derived from Arxiv summarization prompts.",
"downloaded": false,
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"artifact_uri": "artifact://dataset/mooncake-arxiv/mooncake_trace.jsonl",
"size_bytes": null,
"license": "Apache-2.0",
"sha256": "f0c15fb14b60d0afca8b1f7c1ff29378f3df54318e6d112b47ad3b2a2f5881ef",
"source_repository": "https://github.com/kvcache-ai/Mooncake.git",
"supported_backends": ["aiperf", "trace-replayer"]
}
]
}
from llm_d_lens.simulation.backends import list_backends
from llm_d_lens.simulation.traces import trace_registry
backends = list_backends()
for dataset in trace_registry.list():
supported = [
backend.name
for backend in backends
if any(scenario.name == dataset["scenario"] for scenario in backend.scenarios)
and dataset["trace_format"] in backend.capabilities.get("trace_formats", [])
]
print(dataset["name"], supported)
Download a trace dataset
Download a registered trace dataset into Lens's local trace store.
- REST API
- Python API
POST /api/simulation/trace-datasets/download
Request body: TraceDatasetDownloadRequest
dataset(string, required)force(boolean, defaultfalse)
{
"dataset": "mooncake-arxiv",
"force": false
}
Response:
{
"artifact_uri": "artifact://dataset/mooncake-arxiv/mooncake_trace.jsonl",
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"trace_format": "mooncake_trace",
"sha256": "f0c15fb14b60d0afca8b1f7c1ff29378f3df54318e6d112b47ad3b2a2f5881ef",
"metadata_path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl.metadata.json",
"size_bytes": 1048576
}
import asyncio
from llm_d_lens.simulation.traces import BaseTrace
async def main() -> None:
result = await BaseTrace.download("mooncake-arxiv", force=False)
print(result["path"], result["sha256"])
asyncio.run(main())
Get a trace dataset timeline
Get a pre-aggregated timeline view for one trace dataset.
- REST API
- Python API
GET /api/simulation/trace-datasets/{dataset_name}/timeline
Request: no body.
- Path parameter:
dataset_name(string, required) - Query parameter:
bins(integer, default800, range50-2000)
Response:
{
"dataset": "mooncake-arxiv",
"trace_format": "mooncake_trace",
"request_count": 12000,
"duration_seconds": 3600.0,
"source_size_bytes": 1048576,
"bin_width_seconds": 4.5,
"bins": [
{"start_seconds": 0.0, "end_seconds": 4.5, "request_count": 12},
{"start_seconds": 4.5, "end_seconds": 9.0, "request_count": 18}
]
}
import asyncio
from llm_d_lens.simulation.traces import get_trace_timeline
async def main() -> None:
timeline = await get_trace_timeline("mooncake-arxiv", 800)
print(timeline["dataset"], timeline["request_count"])
asyncio.run(main())
List simulation tasks
List Simulation tasks with optional filters for status, scenario, backend, model, dataset, endpoint, and creation window.
- REST API
- Python API
GET /api/simulation/tasks
Request: no body.
- Query parameters:
status,scenario,search,backend,model,dataset,trace_format,endpoint,created_after,created_before,offset,limit.
Response:
{
"tasks": [
{
"id": "1a2b3c4d",
"name": "Trace simulation",
"description": "Replay a chat trace against a ready deployment",
"scenario": "chat",
"status": "running",
"endpoint_mode": "deployment",
"endpoint_namespace": "prism-sim",
"endpoint_service": "qwen-router",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000001",
"endpoint_deployment_run_id": null,
"endpoint_deployment_case_id": null,
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide",
"endpoint_url": "http://127.0.0.1:38000/v1",
"model_name": "Qwen/Qwen3-8B",
"simulation": {
"backend": "trace-replayer",
"backend_options": {},
"duration_seconds": 60.0,
"num_requests": null,
"stream": true,
"warmup_enabled": false,
"grace_period_seconds": 30.0
},
"prompt": {
"type": "trace",
"dataset": {"name": "mooncake-arxiv", "scenario": "chat", "tokenizer": null},
"trace": {
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"format": "mooncake_trace",
"fixed_schedule": true,
"timeout_seconds": 3600.0,
"synthesis_speedup_ratio": 1.0,
"start_seconds": 0.0,
"end_seconds": null
}
},
"task_dir": "/home/prism/.local/share/prism/data/artifacts/simulations/1a2b3c4d",
"artifact_uri": null,
"artifact_error": null,
"logs_truncated": false,
"artifacts_incomplete": false,
"backend_version_inferred": false,
"backend_version": null,
"configuration_ids": ["config-1"],
"progress_percent": 42.5,
"progress_message": "Simulation running",
"logs": [],
"result": null,
"error_message": null,
"created_at": "2026-09-23T09:18:24.287000Z",
"started_at": "2026-09-23T09:18:25.000000Z",
"execution_started_at": "2026-09-23T09:18:27.000000Z",
"completed_at": null,
"owner_pid": null,
"owner_instance_id": null,
"live_summary": {
"completed_requests": 420,
"successful_requests": 418
}
}
],
"total": 1,
"offset": 0,
"limit": 10,
"counts": {
"queued": 0,
"running": 1,
"completed": 0,
"failed": 0,
"cancelled": 0
},
"facets": {
"backends": ["trace-replayer"],
"models": ["Qwen/Qwen3-8B"],
"datasets": ["mooncake-arxiv"],
"trace_formats": ["mooncake_trace"],
"endpoints": ["http://127.0.0.1:38000/v1"]
}
}
import asyncio
from llm_d_lens.simulation.service import list_tasks
async def main() -> None:
page = await list_tasks(status="running", limit=20)
print(page.total, [task.id for task in page.tasks])
asyncio.run(main())
Create a simulation task
For Endpoint URL targets (endpoint_mode != "deployment"), the service checks
/v1/models with the supplied api_key before persisting or scheduling the task.
A failed check returns HTTP 400; direct Python calls raise
SimulationConfigurationError. Manual model names do not bypass this check.
Deployment-bound Model Service tasks retain their cluster execution path.
Create a Simulation task that replays a trace dataset against a target model endpoint.
- REST API
- Python API
POST /api/simulation/tasks
Request body: SimulationTaskCreateRequest
name,description,scenario,backend,endpoint_modecluster_session_id,endpoint_namespace,endpoint_service,endpoint_deployment_execution_id,endpoint_cluster_id,endpoint_cluster_name,endpoint_deployment_namemodel_service_group_id(string, optional) — target a published, continuously health-probed Model Service instead of a raw deployment execution. When set, the backend resolves it to the group's active member and published name and forcesendpoint_modeto"deployment", overriding any suppliedendpoint_deployment_execution_id/model_name. Requiresapi_key.api_key(string, optional) — model access token; required whenmodel_service_group_idis set.endpoint_url,model_name,trace_dataset,trace_pathduration_seconds,scale_factor,trace_start_seconds,trace_end_seconds,trace_timeout_seconds,fixed_schedule,stream,backend_options
{
"name": "Trace simulation",
"description": "Replay a chat trace against a ready deployment",
"scenario": "chat",
"backend": "trace-replayer",
"endpoint_mode": "deployment",
"cluster_session_id": "123e4567-e89b-12d3-a456-426614174000",
"endpoint_namespace": "prism-sim",
"endpoint_service": "qwen-router",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000001",
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide",
"endpoint_url": "http://127.0.0.1:38000/v1",
"model_name": "Qwen/Qwen3-8B",
"trace_dataset": "mooncake-arxiv",
"trace_path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"duration_seconds": 60,
"scale_factor": 1,
"trace_start_seconds": 0,
"trace_end_seconds": null,
"trace_timeout_seconds": 3600,
"fixed_schedule": true,
"stream": true,
"backend_options": {}
}
To target a published Model Service instead, set model_service_group_id and api_key; the
backend discards the supplied endpoint_deployment_execution_id/endpoint_url/model_name and
re-resolves them from the group's active member (a syntactically valid placeholder URL still
satisfies request validation):
{
"name": "Trace simulation",
"scenario": "chat",
"backend": "trace-replayer",
"endpoint_mode": "deployment",
"model_service_group_id": "01998e6b-4b2e-7c7e-8c6d-8e2a3f0c9b11",
"api_key": "lens-mk-…",
"endpoint_url": "http://model-service.internal",
"model_name": "qwen3-8b",
"trace_dataset": "mooncake-arxiv",
"trace_path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl"
}
Response:
{
"task_id": "1a2b3c4d",
"status": "queued",
"task": {
"id": "1a2b3c4d",
"name": "Trace simulation",
"description": "Replay a chat trace against a ready deployment",
"scenario": "chat",
"status": "queued",
"endpoint_mode": "deployment",
"endpoint_namespace": "prism-sim",
"endpoint_service": "qwen-router",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000001",
"endpoint_deployment_run_id": null,
"endpoint_deployment_case_id": null,
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide",
"endpoint_url": "http://127.0.0.1:38000/v1",
"model_name": "Qwen/Qwen3-8B",
"simulation": {
"backend": "trace-replayer",
"backend_options": {},
"duration_seconds": 60.0,
"num_requests": null,
"stream": true,
"warmup_enabled": false,
"grace_period_seconds": 30.0
},
"prompt": {
"type": "trace",
"dataset": {"name": "mooncake-arxiv", "scenario": "chat", "tokenizer": null},
"trace": {
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"format": "mooncake_trace",
"fixed_schedule": true,
"timeout_seconds": 3600.0,
"synthesis_speedup_ratio": 1.0,
"start_seconds": 0.0,
"end_seconds": null
}
},
"task_dir": "/home/prism/.local/share/prism/data/artifacts/simulations/1a2b3c4d",
"artifact_uri": null,
"artifact_error": null,
"logs_truncated": false,
"artifacts_incomplete": false,
"backend_version_inferred": false,
"backend_version": null,
"configuration_ids": ["config-1"],
"progress_percent": 0.0,
"progress_message": "Queued",
"logs": [],
"result": null,
"error_message": null,
"created_at": "2026-09-23T09:18:24.287000Z",
"started_at": null,
"execution_started_at": null,
"completed_at": null,
"owner_pid": null,
"owner_instance_id": null
}
}
import asyncio
from llm_d_lens.simulation.models import SimulationTaskCreateRequest
from llm_d_lens.simulation.service import create_task
async def main() -> None:
task = await create_task(
SimulationTaskCreateRequest(
scenario="chat",
backend="trace-replayer",
endpoint_mode="deployment",
endpoint_deployment_execution_id="00000000-0000-4000-8000-000000000001",
endpoint_url="http://127.0.0.1:38000/v1",
model_name="Qwen/Qwen3-8B",
trace_dataset="mooncake-arxiv",
trace_path="/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
)
)
print(task.id, task.status)
# Or target a published Model Service (resolves to its active member and
# published name; requires api_key, and endpoint_url/model_name are discarded):
task = await create_task(
SimulationTaskCreateRequest(
scenario="chat",
backend="trace-replayer",
endpoint_mode="deployment",
model_service_group_id="01998e6b-4b2e-7c7e-8c6d-8e2a3f0c9b11",
api_key="lens-mk-…",
endpoint_url="http://model-service.internal",
model_name="qwen3-8b",
trace_dataset="mooncake-arxiv",
trace_path="/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
)
)
print(task.id, task.status)
asyncio.run(main())
Get a simulation task
Get one Simulation task by id, including progress, logs, and result artifacts when they exist.
Artifact publication status and errors, log truncation, artifact completeness, backend version provenance, and configuration IDs persist with the task in the database. An artifact URI is returned only after publication has been recorded; an older on-disk manifest alone does not make an unpublished result available.
- REST API
- Python API
GET /api/simulation/tasks/{task_id}
Request: no body.
- Path parameter:
task_id(string, required)
Response:
{
"id": "1a2b3c4d",
"name": "Trace simulation",
"description": "Replay a chat trace against a ready deployment",
"scenario": "chat",
"status": "completed",
"endpoint_mode": "deployment",
"endpoint_namespace": "prism-sim",
"endpoint_service": "qwen-router",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000001",
"endpoint_deployment_run_id": null,
"endpoint_deployment_case_id": null,
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide",
"endpoint_url": "http://127.0.0.1:38000/v1",
"model_name": "Qwen/Qwen3-8B",
"simulation": {
"backend": "trace-replayer",
"backend_options": {},
"duration_seconds": 60.0,
"num_requests": null,
"stream": true,
"warmup_enabled": false,
"grace_period_seconds": 30.0
},
"prompt": {
"type": "trace",
"dataset": {"name": "mooncake-arxiv", "scenario": "chat", "tokenizer": null},
"trace": {
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"format": "mooncake_trace",
"fixed_schedule": true,
"timeout_seconds": 3600.0,
"synthesis_speedup_ratio": 1.0,
"start_seconds": 0.0,
"end_seconds": null
}
},
"task_dir": "/home/prism/.local/share/prism/data/artifacts/simulations/1a2b3c4d",
"artifact_uri": "artifact://simulation/1a2b3c4d",
"artifact_error": null,
"logs_truncated": false,
"artifacts_incomplete": false,
"backend_version_inferred": false,
"backend_version": "0.2.0",
"configuration_ids": ["config-1"],
"progress_percent": 100.0,
"progress_message": "Simulation completed",
"logs": ["Starting trace-replayer", "Simulation completed"],
"result": {
"run_id": "trace-replayer-1",
"backend": "trace-replayer",
"backend_version": "0.2.0",
"summary": {
"throughput_tps": 1180.4,
"success_rate": 99.8,
"completion_timeline": []
},
"artifacts": [
{
"uri": "artifact://simulation/1a2b3c4d/summary.json",
"kind": "summary-json",
"path": "/home/prism/.local/share/prism/data/artifacts/simulations/1a2b3c4d/summary.json",
"media_type": "application/json"
}
],
"per_request": [
{
"request_id": 1,
"status_code": 200,
"successful": true,
"error": null,
"started_at_seconds": 0.0,
"completed_at_seconds": 0.42,
"latency_ms": 420.0,
"ttft_ms": 110.0,
"tpot_ms": 8.3,
"input_tokens": 512.0,
"output_tokens": 128.0,
"metadata": {}
}
],
"backend_metrics": {},
"warnings": []
},
"error_message": null,
"created_at": "2026-09-23T09:18:24.287000Z",
"started_at": "2026-09-23T09:18:25.000000Z",
"execution_started_at": "2026-09-23T09:18:27.000000Z",
"completed_at": "2026-09-23T09:19:32.000000Z",
"owner_pid": null,
"owner_instance_id": null
}
import asyncio
from llm_d_lens.simulation.service import get_task
async def main() -> None:
task = await get_task("1a2b3c4d")
if task is not None:
print(task.id, task.status, task.progress_percent)
asyncio.run(main())
Download a simulation artifact
Download a saved simulation artifact by task id and artifact kind as a file attachment.
- REST API
- Python API
GET /api/simulation/tasks/{task_id}/artifacts/{kind}
Request: no body.
- Path parameters:
task_id(string, required),kind(string, required)
Response: file attachment streamed from the saved artifact path. No JSON body is returned. The task's result.artifacts list tells you which kind values are available.
import asyncio
from llm_d_lens.simulation.router import download_simulation_artifact
async def main() -> None:
response = await download_simulation_artifact("1a2b3c4d", "summary-json")
print(response.media_type)
asyncio.run(main())
Get response-code issues for a simulation task
Get requests from a Simulation task that returned a specific HTTP status code.
- REST API
- Python API
GET /api/simulation/tasks/{task_id}/response-code-issues
Request: no body.
- Path parameter:
task_id(string, required) - Query parameters:
status_code(string, required; useunknownfor missing status),offset(integer, default0),limit(integer, default100, max500)
Response:
{
"task_id": "1a2b3c4d",
"status_code": 500,
"issues": [
{
"request_number": 12,
"request_id": 12,
"status_code": 500,
"error": "Transport error: upstream reset the connection",
"started_at_seconds": 14.2,
"latency_ms": 982.5,
"input_tokens": 512.0,
"output_tokens": 0.0
}
],
"total": 1,
"offset": 0,
"limit": 100
}
import asyncio
from llm_d_lens.simulation.service import get_response_code_issues
async def main() -> None:
issues = await get_response_code_issues("1a2b3c4d", 500, offset=0, limit=20)
print(issues.task_id, issues.total)
asyncio.run(main())
Stop a simulation task
Stop an active Simulation task.
- REST API
- Python API
POST /api/simulation/tasks/{task_id}/stop
Request: no body.
- Path parameter:
task_id(string, required)
Response:
{
"task_id": "1a2b3c4d",
"status": "cancelling"
}
import asyncio
from llm_d_lens.simulation.service import stop_task
async def main() -> None:
await stop_task("1a2b3c4d")
asyncio.run(main())
Rerun a simulation task
For Endpoint URL targets (endpoint_mode != "deployment"), the service checks
/v1/models with the supplied api_key before persisting or scheduling the task.
A failed check returns HTTP 400; direct Python calls raise
SimulationConfigurationError. Manual model names do not bypass this check.
Deployment-bound Model Service tasks retain their cluster execution path.
Queue a rerun of a previous Simulation task, optionally rebinding it to a fresh endpoint or deployment execution.
- REST API
- Python API
POST /api/simulation/tasks/{task_id}/rerun
Request body: SimulationTaskRerunRequest (optional)
- Path parameter:
task_id(string, required) - Optional body fields:
endpoint_url,endpoint_deployment_execution_id,endpoint_cluster_id,endpoint_cluster_name,endpoint_deployment_name model_service_group_id(string, optional) — re-bind to a published, health-probed Model Service instead of a raw deployment execution; resolved the same way as on task creation and preferred overendpoint_deployment_execution_idwhen both are supplied.
{
"endpoint_url": "http://127.0.0.1:39000/v1",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000002",
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide-rerun"
}
Response:
{
"task_id": "5e6f7a8b",
"status": "queued",
"task": {
"id": "5e6f7a8b",
"name": "Trace simulation · rerun 5e6f7a8b",
"description": "Replay a chat trace against a ready deployment",
"scenario": "chat",
"status": "queued",
"endpoint_mode": "deployment",
"endpoint_namespace": "prism-sim",
"endpoint_service": "qwen-router",
"endpoint_deployment_execution_id": "00000000-0000-4000-8000-000000000002",
"endpoint_deployment_run_id": null,
"endpoint_deployment_case_id": null,
"endpoint_cluster_id": "cluster-1",
"endpoint_cluster_name": "dev-cluster",
"endpoint_deployment_name": "qwen3-guide-rerun",
"endpoint_url": "http://127.0.0.1:39000/v1",
"model_name": "Qwen/Qwen3-8B",
"simulation": {
"backend": "trace-replayer",
"backend_options": {},
"duration_seconds": 60.0,
"num_requests": null,
"stream": true,
"warmup_enabled": false,
"grace_period_seconds": 30.0
},
"prompt": {
"type": "trace",
"dataset": {"name": "mooncake-arxiv", "scenario": "chat", "tokenizer": null},
"trace": {
"path": "/home/prism/.local/share/prism/data/datasets/mooncake_trace.jsonl",
"format": "mooncake_trace",
"fixed_schedule": true,
"timeout_seconds": 3600.0,
"synthesis_speedup_ratio": 1.0,
"start_seconds": 0.0,
"end_seconds": null
}
},
"task_dir": "/home/prism/.local/share/prism/data/artifacts/simulations/5e6f7a8b",
"artifact_uri": null,
"artifact_error": null,
"logs_truncated": false,
"artifacts_incomplete": false,
"backend_version_inferred": false,
"backend_version": null,
"configuration_ids": ["config-2"],
"progress_percent": 0.0,
"progress_message": "Queued",
"logs": [],
"result": null,
"error_message": null,
"created_at": "2026-09-23T09:25:24.287000Z",
"started_at": null,
"execution_started_at": null,
"completed_at": null,
"owner_pid": null,
"owner_instance_id": null
}
}
import asyncio
from llm_d_lens.simulation.models import SimulationTaskRerunRequest
from llm_d_lens.simulation.service import rerun_task
async def main() -> None:
task = await rerun_task(
"1a2b3c4d",
override=SimulationTaskRerunRequest(
endpoint_deployment_execution_id="00000000-0000-4000-8000-000000000002",
endpoint_url="http://127.0.0.1:39000/v1",
),
)
print(task.id, task.name)
# Or re-bind to a published Model Service (preferred over
# endpoint_deployment_execution_id when both are supplied):
task = await rerun_task(
"1a2b3c4d",
override=SimulationTaskRerunRequest(model_service_group_id="01998e6b-4b2e-7c7e-8c6d-8e2a3f0c9b11"),
)
print(task.id, task.name)
asyncio.run(main())
Delete a simulation task
Delete a Simulation task record.
- REST API
- Python API
DELETE /api/simulation/tasks/{task_id}
Request: no body.
- Path parameter:
task_id(string, required)
Response:
{
"task_id": "1a2b3c4d",
"status": "deleted"
}
import asyncio
from llm_d_lens.simulation.service import delete_task
async def main() -> None:
await delete_task("1a2b3c4d")
asyncio.run(main())
See the full request/response schemas in the FastAPI OpenAPI schema (regenerate with npm run docs:api).