llama-stack-mirror/docs/static/experimental-llama-stack-spec.yaml
Sébastien Han a019d0e02a
chore: use Pydantic to generate OpenAPI schema
Removes the need for the strong_typing and pyopenapi packages and purely
use Pydantic for schema generation.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-11-04 10:02:46 +01:00

2817 lines
86 KiB
YAML

openapi: 3.1.0
info:
title: Llama Stack API
description: A comprehensive API for building and deploying AI applications
version: 1.0.0
servers:
- url: https://api.llamastack.com
description: Production server
- url: https://staging-api.llamastack.com
description: Staging server
paths:
/v1beta/datasetio/append-rows/{dataset_id}:
post:
tags:
- V1Beta
summary: Append Rows
description: Generic endpoint - this would be replaced with actual implementation.
operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1beta/datasetio/iterrows/{dataset_id}:
get:
tags:
- V1Beta
summary: Iterrows
description: Query endpoint for proper schema generation.
operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get
parameters:
- name: dataset_id
in: path
required: true
schema:
type: string
title: Dataset Id
- name: start_index
in: query
required: false
schema:
type: integer
title: Start Index
- name: limit
in: query
required: false
schema:
type: integer
title: Limit
responses:
'200':
description: A PaginatedResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1beta/datasets:
get:
tags:
- V1Beta
summary: List Datasets
description: Response-only endpoint for proper schema generation.
operationId: list_datasets_v1beta_datasets_get
responses:
'200':
description: A ListDatasetsResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/ListDatasetsResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
post:
tags:
- V1Beta
summary: Register Dataset
description: Query endpoint for proper schema generation.
operationId: register_dataset_v1beta_datasets_post
parameters:
- name: purpose
in: query
required: false
schema:
$ref: '#/components/schemas/DatasetPurpose'
- name: metadata
in: query
required: false
schema:
type: string
title: Metadata
- name: dataset_id
in: query
required: false
schema:
type: string
title: Dataset Id
responses:
'200':
description: A Dataset.
content:
application/json:
schema:
$ref: '#/components/schemas/Dataset'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1beta/datasets/{dataset_id}:
delete:
tags:
- V1Beta
summary: Unregister Dataset
description: Generic endpoint - this would be replaced with actual implementation.
operationId: unregister_dataset_v1beta_datasets__dataset_id__delete
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
get:
tags:
- V1Beta
summary: Get Dataset
description: Query endpoint for proper schema generation.
operationId: get_dataset_v1beta_datasets__dataset_id__get
parameters:
- name: dataset_id
in: path
required: true
schema:
type: string
title: Dataset Id
responses:
'200':
description: A Dataset.
content:
application/json:
schema:
$ref: '#/components/schemas/Dataset'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents:
get:
tags:
- V1Alpha
summary: List Agents
description: Query endpoint for proper schema generation.
operationId: list_agents_v1alpha_agents_get
parameters:
- name: start_index
in: query
required: false
schema:
type: integer
title: Start Index
- name: limit
in: query
required: false
schema:
type: integer
title: Limit
responses:
'200':
description: A PaginatedResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
post:
tags:
- V1Alpha
summary: Create Agent
description: Typed endpoint for proper schema generation.
operationId: create_agent_v1alpha_agents_post
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentConfig'
responses:
'200':
description: An AgentCreateResponse with the agent ID.
content:
application/json:
schema:
$ref: '#/components/schemas/AgentCreateResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}:
delete:
tags:
- V1Alpha
summary: Delete Agent
description: Generic endpoint - this would be replaced with actual implementation.
operationId: delete_agent_v1alpha_agents__agent_id__delete
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
get:
tags:
- V1Alpha
summary: Get Agent
description: Query endpoint for proper schema generation.
operationId: get_agent_v1alpha_agents__agent_id__get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
responses:
'200':
description: An Agent of the agent.
content:
application/json:
schema:
$ref: '#/components/schemas/Agent'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session:
post:
tags:
- V1Alpha
summary: Create Agent Session
description: Query endpoint for proper schema generation.
operationId: create_agent_session_v1alpha_agents__agent_id__session_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: session_name
in: query
required: false
schema:
type: string
title: Session Name
responses:
'200':
description: An AgentSessionCreateResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/AgentSessionCreateResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session/{session_id}:
delete:
tags:
- V1Alpha
summary: Delete Agents Session
description: Generic endpoint - this would be replaced with actual implementation.
operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
get:
tags:
- V1Alpha
summary: Get Agents Session
description: Query endpoint for proper schema generation.
operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get
parameters:
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: turn_ids
in: query
required: false
schema:
type: string
title: Turn Ids
responses:
'200':
description: A Session.
content:
application/json:
schema:
$ref: '#/components/schemas/Session'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session/{session_id}/turn:
post:
tags:
- V1Alpha
summary: Create Agent Turn
description: Query endpoint for proper schema generation.
operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
- name: stream
in: query
required: false
schema:
type: boolean
default: false
title: Stream
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post'
responses:
'200':
description: If stream=False, returns a Turn object.
content:
application/json:
schema:
$ref: '#/components/schemas/Turn'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}:
get:
tags:
- V1Alpha
summary: Get Agents Turn
description: Query endpoint for proper schema generation.
operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
- name: turn_id
in: path
required: true
schema:
type: string
title: Turn Id
responses:
'200':
description: A Turn.
content:
application/json:
schema:
$ref: '#/components/schemas/Turn'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume:
post:
tags:
- V1Alpha
summary: Resume Agent Turn
description: Query endpoint for proper schema generation.
operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
- name: turn_id
in: path
required: true
schema:
type: string
title: Turn Id
- name: stream
in: query
required: false
schema:
type: boolean
default: false
title: Stream
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ToolResponse'
responses:
'200':
description: A Turn object if stream is False, otherwise an AsyncIterator
of AgentTurnResponseStreamChunk objects.
content:
application/json:
schema:
$ref: '#/components/schemas/Turn'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}:
get:
tags:
- V1Alpha
summary: Get Agents Step
description: Query endpoint for proper schema generation.
operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: session_id
in: path
required: true
schema:
type: string
title: Session Id
- name: turn_id
in: path
required: true
schema:
type: string
title: Turn Id
- name: step_id
in: path
required: true
schema:
type: string
title: Step Id
responses:
'200':
description: An AgentStepResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/AgentStepResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/agents/{agent_id}/sessions:
get:
tags:
- V1Alpha
summary: List Agent Sessions
description: Query endpoint for proper schema generation.
operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
title: Agent Id
- name: start_index
in: query
required: false
schema:
type: integer
title: Start Index
- name: limit
in: query
required: false
schema:
type: integer
title: Limit
responses:
'200':
description: A PaginatedResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/eval/benchmarks:
get:
tags:
- V1Alpha
summary: List Benchmarks
description: Response-only endpoint for proper schema generation.
operationId: list_benchmarks_v1alpha_eval_benchmarks_get
responses:
'200':
description: A ListBenchmarksResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/ListBenchmarksResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
post:
tags:
- V1Alpha
summary: Register Benchmark
description: Generic endpoint - this would be replaced with actual implementation.
operationId: register_benchmark_v1alpha_eval_benchmarks_post
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/eval/benchmarks/{benchmark_id}:
delete:
tags:
- V1Alpha
summary: Unregister Benchmark
description: Generic endpoint - this would be replaced with actual implementation.
operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
get:
tags:
- V1Alpha
summary: Get Benchmark
description: Query endpoint for proper schema generation.
operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get
parameters:
- name: benchmark_id
in: path
required: true
schema:
type: string
title: Benchmark Id
responses:
'200':
description: A Benchmark.
content:
application/json:
schema:
$ref: '#/components/schemas/Benchmark'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/eval/benchmarks/{benchmark_id}/evaluations:
post:
tags:
- V1Alpha
summary: Evaluate Rows
description: Typed endpoint for proper schema generation.
operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BenchmarkConfig'
required: true
responses:
'200':
description: EvaluateResponse object containing generations and scores.
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluateResponse'
'400':
description: Bad Request
$ref: '#/components/responses/BadRequest400'
'429':
description: Too Many Requests
$ref: '#/components/responses/TooManyRequests429'
'500':
description: Internal Server Error
$ref: '#/components/responses/InternalServerError500'
default:
description: Default Response
$ref: '#/components/responses/DefaultError'
/v1alpha/eval/benchmarks/{benchmark_id}/jobs:
post:
tags:
- V1Alpha
summary: Run Eval
description: Typed endpoint for proper schema generation.
operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BenchmarkConfig'
required: true
responses:
'200':
description: The job that was created to run the evaluation.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
description: Bad Request
$ref: '#/components/responses/BadRequest400'
'429':
description: Too Many Requests
$ref: '#/components/responses/TooManyRequests429'
'500':
description: Internal Server Error
$ref: '#/components/responses/InternalServerError500'
default:
description: Default Response
$ref: '#/components/responses/DefaultError'
/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}:
delete:
tags:
- V1Alpha
summary: Job Cancel
description: Generic endpoint - this would be replaced with actual implementation.
operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
get:
tags:
- V1Alpha
summary: Job Status
description: Query endpoint for proper schema generation.
operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get
parameters:
- name: benchmark_id
in: path
required: true
schema:
type: string
title: Benchmark Id
- name: job_id
in: path
required: true
schema:
type: string
title: Job Id
responses:
'200':
description: The status of the evaluation job.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result:
get:
tags:
- V1Alpha
summary: Job Result
description: Query endpoint for proper schema generation.
operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get
parameters:
- name: benchmark_id
in: path
required: true
schema:
type: string
title: Benchmark Id
- name: job_id
in: path
required: true
schema:
type: string
title: Job Id
responses:
'200':
description: The result of the job.
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluateResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/inference/rerank:
post:
tags:
- V1Alpha
summary: Rerank
description: Query endpoint for proper schema generation.
operationId: rerank_v1alpha_inference_rerank_post
parameters:
- name: model
in: query
required: false
schema:
type: string
title: Model
- name: query
in: query
required: false
schema:
type: string
title: Query
- name: items
in: query
required: false
schema:
type: string
title: Items
- name: max_num_results
in: query
required: false
schema:
type: integer
title: Max Num Results
responses:
'200':
description: RerankResponse with indices sorted by relevance score (descending).
content:
application/json:
schema:
$ref: '#/components/schemas/RerankResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/post-training/job/artifacts:
get:
tags:
- V1Alpha
summary: Get Training Job Artifacts
description: Query endpoint for proper schema generation.
operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get
parameters:
- name: job_uuid
in: query
required: false
schema:
type: string
title: Job Uuid
responses:
'200':
description: A PostTrainingJobArtifactsResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/PostTrainingJobArtifactsResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/post-training/job/cancel:
post:
tags:
- V1Alpha
summary: Cancel Training Job
description: Generic endpoint - this would be replaced with actual implementation.
operationId: cancel_training_job_v1alpha_post_training_job_cancel_post
parameters:
- name: args
in: query
required: true
schema:
title: Args
- name: kwargs
in: query
required: true
schema:
title: Kwargs
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/post-training/job/status:
get:
tags:
- V1Alpha
summary: Get Training Job Status
description: Query endpoint for proper schema generation.
operationId: get_training_job_status_v1alpha_post_training_job_status_get
parameters:
- name: job_uuid
in: query
required: false
schema:
type: string
title: Job Uuid
responses:
'200':
description: A PostTrainingJobStatusResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/PostTrainingJobStatusResponse'
'400':
$ref: '#/components/responses/BadRequest400'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequests429'
description: Too Many Requests
'500':
$ref: '#/components/responses/InternalServerError500'
description: Internal Server Error
default:
$ref: '#/components/responses/DefaultError'
description: Default Response
/v1alpha/post-training/jobs:
get:
tags:
- V1Alpha
summary: Get Training Jobs
description: Response-only endpoint for proper schema generation.
operationId: get_training_jobs_v1alpha_post_training_jobs_get
responses:
'200':
description: A ListPostTrainingJobsResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/ListPostTrainingJobsResponse'
'400':
description: Bad Request
$ref: '#/components/responses/BadRequest400'
'429':
description: Too Many Requests
$ref: '#/components/responses/TooManyRequests429'
'500':
description: Internal Server Error
$ref: '#/components/responses/InternalServerError500'
default:
description: Default Response
$ref: '#/components/responses/DefaultError'
/v1alpha/post-training/preference-optimize:
post:
tags:
- V1Alpha
summary: Preference Optimize
description: Typed endpoint for proper schema generation.
operationId: preference_optimize_v1alpha_post_training_preference_optimize_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DPOAlignmentConfig'
required: true
responses:
'200':
description: A PostTrainingJob.
content:
application/json:
schema:
$ref: '#/components/schemas/PostTrainingJob'
'400':
description: Bad Request
$ref: '#/components/responses/BadRequest400'
'429':
description: Too Many Requests
$ref: '#/components/responses/TooManyRequests429'
'500':
description: Internal Server Error
$ref: '#/components/responses/InternalServerError500'
default:
description: Default Response
$ref: '#/components/responses/DefaultError'
/v1alpha/post-training/supervised-fine-tune:
post:
tags:
- V1Alpha
summary: Supervised Fine Tune
description: Typed endpoint for proper schema generation.
operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingConfig'
required: true
responses:
'200':
description: A PostTrainingJob.
content:
application/json:
schema:
$ref: '#/components/schemas/PostTrainingJob'
'400':
description: Bad Request
$ref: '#/components/responses/BadRequest400'
'429':
description: Too Many Requests
$ref: '#/components/responses/TooManyRequests429'
'500':
description: Internal Server Error
$ref: '#/components/responses/InternalServerError500'
default:
description: Default Response
$ref: '#/components/responses/DefaultError'
components:
schemas:
AgentCandidate:
properties:
type:
type: string
const: agent
title: Type
default: agent
config:
$ref: '#/components/schemas/AgentConfig'
type: object
required:
- config
title: AgentCandidate
description: 'An agent candidate for evaluation.
:param config: The configuration for the agent candidate.'
AgentConfig:
properties:
sampling_params:
anyOf:
- $ref: '#/components/schemas/SamplingParams'
- type: 'null'
input_shields:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Input Shields
output_shields:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Output Shields
toolgroups:
anyOf:
- items:
anyOf:
- type: string
- $ref: '#/components/schemas/AgentToolGroupWithArgs'
type: array
- type: 'null'
title: Toolgroups
client_tools:
anyOf:
- items:
$ref: '#/components/schemas/ToolDef'
type: array
- type: 'null'
title: Client Tools
tool_choice:
anyOf:
- $ref: '#/components/schemas/ToolChoice'
- type: 'null'
deprecated: true
tool_prompt_format:
anyOf:
- $ref: '#/components/schemas/ToolPromptFormat'
- type: 'null'
deprecated: true
tool_config:
anyOf:
- $ref: '#/components/schemas/ToolConfig'
- type: 'null'
max_infer_iters:
anyOf:
- type: integer
- type: 'null'
title: Max Infer Iters
default: 10
model:
type: string
title: Model
instructions:
type: string
title: Instructions
name:
anyOf:
- type: string
- type: 'null'
title: Name
enable_session_persistence:
anyOf:
- type: boolean
- type: 'null'
title: Enable Session Persistence
default: false
response_format:
anyOf:
- oneOf:
- $ref: '#/components/schemas/JsonSchemaResponseFormat'
- $ref: '#/components/schemas/GrammarResponseFormat'
discriminator:
propertyName: type
mapping:
grammar: '#/components/schemas/GrammarResponseFormat'
json_schema: '#/components/schemas/JsonSchemaResponseFormat'
- type: 'null'
title: Response Format
type: object
required:
- model
- instructions
title: AgentConfig
description: 'Configuration for an agent.
:param model: The model identifier to use for the agent
:param instructions: The system instructions for the agent
:param name: Optional name for the agent, used in telemetry and identification
:param enable_session_persistence: Optional flag indicating whether session
data has to be persisted
:param response_format: Optional response format configuration'
AgentCreateResponse:
properties:
agent_id:
type: string
title: Agent Id
type: object
required:
- agent_id
title: AgentCreateResponse
description: 'Response returned when creating a new agent.
:param agent_id: Unique identifier for the created agent'
AgentToolGroupWithArgs:
properties:
name:
type: string
title: Name
args:
additionalProperties: true
type: object
title: Args
type: object
required:
- name
- args
title: AgentToolGroupWithArgs
AggregationFunctionType:
type: string
enum:
- average
- weighted_average
- median
- categorical_count
- accuracy
title: AggregationFunctionType
description: 'Types of aggregation functions for scoring results.
:cvar average: Calculate the arithmetic mean of scores
:cvar weighted_average: Calculate a weighted average of scores
:cvar median: Calculate the median value of scores
:cvar categorical_count: Count occurrences of categorical values
:cvar accuracy: Calculate accuracy as the proportion of correct answers'
BasicScoringFnParams:
properties:
type:
type: string
const: basic
title: Type
default: basic
aggregation_functions:
items:
$ref: '#/components/schemas/AggregationFunctionType'
type: array
title: Aggregation Functions
description: Aggregation functions to apply to the scores of each row
type: object
title: BasicScoringFnParams
description: 'Parameters for basic scoring function configuration.
:param type: The type of scoring function parameters, always basic
:param aggregation_functions: Aggregation functions to apply to the scores
of each row'
Benchmark:
properties:
identifier:
type: string
title: Identifier
description: Unique identifier for this resource in llama stack
provider_resource_id:
anyOf:
- type: string
- type: 'null'
title: Provider Resource Id
description: Unique identifier for this resource in the provider
provider_id:
type: string
title: Provider Id
description: ID of the provider that owns this resource
type:
type: string
const: benchmark
title: Type
default: benchmark
dataset_id:
type: string
title: Dataset Id
scoring_functions:
items:
type: string
type: array
title: Scoring Functions
metadata:
additionalProperties: true
type: object
title: Metadata
description: Metadata for this evaluation task
type: object
required:
- identifier
- provider_id
- dataset_id
- scoring_functions
title: Benchmark
description: 'A benchmark resource for evaluating model performance.
:param dataset_id: Identifier of the dataset to use for the benchmark evaluation
:param scoring_functions: List of scoring function identifiers to apply during
evaluation
:param metadata: Metadata for this evaluation task
:param type: The resource type, always benchmark'
BenchmarkConfig:
properties:
eval_candidate:
oneOf:
- $ref: '#/components/schemas/ModelCandidate'
- $ref: '#/components/schemas/AgentCandidate'
title: Eval Candidate
discriminator:
propertyName: type
mapping:
agent: '#/components/schemas/AgentCandidate'
model: '#/components/schemas/ModelCandidate'
scoring_params:
additionalProperties:
oneOf:
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
- $ref: '#/components/schemas/RegexParserScoringFnParams'
- $ref: '#/components/schemas/BasicScoringFnParams'
discriminator:
propertyName: type
mapping:
basic: '#/components/schemas/BasicScoringFnParams'
llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams'
regex_parser: '#/components/schemas/RegexParserScoringFnParams'
type: object
title: Scoring Params
description: Map between scoring function id and parameters for each scoring
function you want to run
num_examples:
anyOf:
- type: integer
- type: 'null'
title: Num Examples
description: Number of examples to evaluate (useful for testing), if not
provided, all examples in the dataset will be evaluated
type: object
required:
- eval_candidate
title: BenchmarkConfig
description: 'A benchmark configuration for evaluation.
:param eval_candidate: The candidate to evaluate.
:param scoring_params: Map between scoring function id and parameters for
each scoring function you want to run
:param num_examples: (Optional) The number of examples to evaluate. If not
provided, all examples in the dataset will be evaluated'
Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post:
properties:
messages:
$ref: '#/components/schemas/UserMessage'
documents:
$ref: '#/components/schemas/Document'
toolgroups:
anyOf:
- type: string
- $ref: '#/components/schemas/AgentToolGroupWithArgs'
title: Toolgroups
tool_config:
$ref: '#/components/schemas/ToolConfig'
type: object
title: Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post
BuiltinTool:
type: string
enum:
- brave_search
- wolfram_alpha
- photogen
- code_interpreter
title: BuiltinTool
DPOAlignmentConfig:
properties:
beta:
type: number
title: Beta
loss_type:
$ref: '#/components/schemas/DPOLossType'
default: sigmoid
type: object
required:
- beta
title: DPOAlignmentConfig
description: 'Configuration for Direct Preference Optimization (DPO) alignment.
:param beta: Temperature parameter for the DPO loss
:param loss_type: The type of loss function to use for DPO'
DPOLossType:
type: string
enum:
- sigmoid
- hinge
- ipo
- kto_pair
title: DPOLossType
DataConfig:
properties:
dataset_id:
type: string
title: Dataset Id
batch_size:
type: integer
title: Batch Size
shuffle:
type: boolean
title: Shuffle
data_format:
$ref: '#/components/schemas/DatasetFormat'
validation_dataset_id:
anyOf:
- type: string
- type: 'null'
title: Validation Dataset Id
packed:
anyOf:
- type: boolean
- type: 'null'
title: Packed
default: false
train_on_input:
anyOf:
- type: boolean
- type: 'null'
title: Train On Input
default: false
type: object
required:
- dataset_id
- batch_size
- shuffle
- data_format
title: DataConfig
description: 'Configuration for training data and data loading.
:param dataset_id: Unique identifier for the training dataset
:param batch_size: Number of samples per training batch
:param shuffle: Whether to shuffle the dataset during training
:param data_format: Format of the dataset (instruct or dialog)
:param validation_dataset_id: (Optional) Unique identifier for the validation
dataset
:param packed: (Optional) Whether to pack multiple samples into a single sequence
for efficiency
:param train_on_input: (Optional) Whether to compute loss on input tokens
as well as output tokens'
Dataset:
properties:
identifier:
type: string
title: Identifier
description: Unique identifier for this resource in llama stack
provider_resource_id:
anyOf:
- type: string
- type: 'null'
title: Provider Resource Id
description: Unique identifier for this resource in the provider
provider_id:
type: string
title: Provider Id
description: ID of the provider that owns this resource
type:
type: string
const: dataset
title: Type
default: dataset
purpose:
$ref: '#/components/schemas/DatasetPurpose'
source:
oneOf:
- $ref: '#/components/schemas/URIDataSource'
- $ref: '#/components/schemas/RowsDataSource'
title: Source
discriminator:
propertyName: type
mapping:
rows: '#/components/schemas/RowsDataSource'
uri: '#/components/schemas/URIDataSource'
metadata:
additionalProperties: true
type: object
title: Metadata
description: Any additional metadata for this dataset
type: object
required:
- identifier
- provider_id
- purpose
- source
title: Dataset
description: 'Dataset resource for storing and accessing training or evaluation
data.
:param type: Type of resource, always ''dataset'' for datasets'
DatasetFormat:
type: string
enum:
- instruct
- dialog
title: DatasetFormat
description: 'Format of the training dataset.
:cvar instruct: Instruction-following format with prompt and completion
:cvar dialog: Multi-turn conversation format with messages'
DatasetPurpose:
type: string
enum:
- post-training/messages
- eval/question-answer
- eval/messages-answer
title: DatasetPurpose
description: "Purpose of the dataset. Each purpose has a required input data\
\ schema.\n\n:cvar post-training/messages: The dataset contains messages used\
\ for post-training.\n {\n \"messages\": [\n {\"role\"\
: \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\"\
, \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer:\
\ The dataset contains a question column and an answer column.\n {\n \
\ \"question\": \"What is the capital of France?\",\n \"answer\"\
: \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages\
\ column with list of messages and an answer column.\n {\n \"messages\"\
: [\n {\"role\": \"user\", \"content\": \"Hello, my name is John\
\ Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John\
\ Doe. How can I help you today?\"},\n {\"role\": \"user\", \"\
content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\
\n }"
Document:
properties:
content:
anyOf:
- type: string
- oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
- items:
oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
type: array
- $ref: '#/components/schemas/URL'
title: Content
mime_type:
type: string
title: Mime Type
type: object
required:
- content
- mime_type
title: Document
description: 'A document to be used by an agent.
:param content: The content of the document.
:param mime_type: The MIME type of the document.'
EfficiencyConfig:
properties:
enable_activation_checkpointing:
anyOf:
- type: boolean
- type: 'null'
title: Enable Activation Checkpointing
default: false
enable_activation_offloading:
anyOf:
- type: boolean
- type: 'null'
title: Enable Activation Offloading
default: false
memory_efficient_fsdp_wrap:
anyOf:
- type: boolean
- type: 'null'
title: Memory Efficient Fsdp Wrap
default: false
fsdp_cpu_offload:
anyOf:
- type: boolean
- type: 'null'
title: Fsdp Cpu Offload
default: false
type: object
title: EfficiencyConfig
description: 'Configuration for memory and compute efficiency optimizations.
:param enable_activation_checkpointing: (Optional) Whether to use activation
checkpointing to reduce memory usage
:param enable_activation_offloading: (Optional) Whether to offload activations
to CPU to save GPU memory
:param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient
FSDP wrapping
:param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to
CPU'
EvaluateResponse:
properties:
generations:
items:
additionalProperties: true
type: object
type: array
title: Generations
scores:
additionalProperties:
$ref: '#/components/schemas/ScoringResult'
type: object
title: Scores
type: object
required:
- generations
- scores
title: EvaluateResponse
description: 'The response from an evaluation.
:param generations: The generations from the evaluation.
:param scores: The scores from the evaluation.'
GrammarResponseFormat:
properties:
type:
type: string
const: grammar
title: Type
default: grammar
bnf:
additionalProperties: true
type: object
title: Bnf
type: object
required:
- bnf
title: GrammarResponseFormat
description: 'Configuration for grammar-guided response generation.
:param type: Must be "grammar" to identify this format type
:param bnf: The BNF grammar specification the response should conform to'
GreedySamplingStrategy:
properties:
type:
type: string
const: greedy
title: Type
default: greedy
type: object
title: GreedySamplingStrategy
description: 'Greedy sampling strategy that selects the highest probability
token at each step.
:param type: Must be "greedy" to identify this sampling strategy'
ImageContentItem:
properties:
type:
type: string
const: image
title: Type
default: image
image:
$ref: '#/components/schemas/_URLOrData'
type: object
required:
- image
title: ImageContentItem
description: 'A image content item
:param type: Discriminator type of the content item. Always "image"
:param image: Image as a base64 encoded string or an URL'
Job:
properties:
job_id:
type: string
title: Job Id
status:
$ref: '#/components/schemas/JobStatus'
type: object
required:
- job_id
- status
title: Job
description: 'A job execution instance with status tracking.
:param job_id: Unique identifier for the job
:param status: Current execution status of the job'
JobStatus:
type: string
enum:
- completed
- in_progress
- failed
- scheduled
- cancelled
title: JobStatus
description: 'Status of a job execution.
:cvar completed: Job has finished successfully
:cvar in_progress: Job is currently running
:cvar failed: Job has failed during execution
:cvar scheduled: Job is scheduled but not yet started
:cvar cancelled: Job was cancelled before completion'
JsonSchemaResponseFormat:
properties:
type:
type: string
const: json_schema
title: Type
default: json_schema
json_schema:
additionalProperties: true
type: object
title: Json Schema
type: object
required:
- json_schema
title: JsonSchemaResponseFormat
description: 'Configuration for JSON schema-guided response generation.
:param type: Must be "json_schema" to identify this format type
:param json_schema: The JSON schema the response should conform to. In a Python
SDK, this is often a `pydantic` model.'
LLMAsJudgeScoringFnParams:
properties:
type:
type: string
const: llm_as_judge
title: Type
default: llm_as_judge
judge_model:
type: string
title: Judge Model
prompt_template:
anyOf:
- type: string
- type: 'null'
title: Prompt Template
judge_score_regexes:
items:
type: string
type: array
title: Judge Score Regexes
description: Regexes to extract the answer from generated response
aggregation_functions:
items:
$ref: '#/components/schemas/AggregationFunctionType'
type: array
title: Aggregation Functions
description: Aggregation functions to apply to the scores of each row
type: object
required:
- judge_model
title: LLMAsJudgeScoringFnParams
description: 'Parameters for LLM-as-judge scoring function configuration.
:param type: The type of scoring function parameters, always llm_as_judge
:param judge_model: Identifier of the LLM model to use as a judge for scoring
:param prompt_template: (Optional) Custom prompt template for the judge model
:param judge_score_regexes: Regexes to extract the answer from generated response
:param aggregation_functions: Aggregation functions to apply to the scores
of each row'
ListBenchmarksResponse:
properties:
data:
items:
$ref: '#/components/schemas/Benchmark'
type: array
title: Data
type: object
required:
- data
title: ListBenchmarksResponse
ListDatasetsResponse:
properties:
data:
items:
$ref: '#/components/schemas/Dataset'
type: array
title: Data
type: object
required:
- data
title: ListDatasetsResponse
description: 'Response from listing datasets.
:param data: List of datasets'
ListPostTrainingJobsResponse:
properties:
data:
items:
$ref: '#/components/schemas/PostTrainingJob'
type: array
title: Data
type: object
required:
- data
title: ListPostTrainingJobsResponse
ModelCandidate:
properties:
type:
type: string
const: model
title: Type
default: model
model:
type: string
title: Model
sampling_params:
$ref: '#/components/schemas/SamplingParams'
system_message:
anyOf:
- $ref: '#/components/schemas/SystemMessage'
- type: 'null'
type: object
required:
- model
- sampling_params
title: ModelCandidate
description: 'A model candidate for evaluation.
:param model: The model ID to evaluate.
:param sampling_params: The sampling parameters for the model.
:param system_message: (Optional) The system message providing instructions
or context to the model.'
OptimizerConfig:
properties:
optimizer_type:
$ref: '#/components/schemas/OptimizerType'
lr:
type: number
title: Lr
weight_decay:
type: number
title: Weight Decay
num_warmup_steps:
type: integer
title: Num Warmup Steps
type: object
required:
- optimizer_type
- lr
- weight_decay
- num_warmup_steps
title: OptimizerConfig
description: 'Configuration parameters for the optimization algorithm.
:param optimizer_type: Type of optimizer to use (adam, adamw, or sgd)
:param lr: Learning rate for the optimizer
:param weight_decay: Weight decay coefficient for regularization
:param num_warmup_steps: Number of steps for learning rate warmup'
OptimizerType:
type: string
enum:
- adam
- adamw
- sgd
title: OptimizerType
description: 'Available optimizer algorithms for training.
:cvar adam: Adaptive Moment Estimation optimizer
:cvar adamw: AdamW optimizer with weight decay
:cvar sgd: Stochastic Gradient Descent optimizer'
PostTrainingJob:
properties:
job_uuid:
type: string
title: Job Uuid
type: object
required:
- job_uuid
title: PostTrainingJob
RegexParserScoringFnParams:
properties:
type:
type: string
const: regex_parser
title: Type
default: regex_parser
parsing_regexes:
items:
type: string
type: array
title: Parsing Regexes
description: Regex to extract the answer from generated response
aggregation_functions:
items:
$ref: '#/components/schemas/AggregationFunctionType'
type: array
title: Aggregation Functions
description: Aggregation functions to apply to the scores of each row
type: object
title: RegexParserScoringFnParams
description: 'Parameters for regex parser scoring function configuration.
:param type: The type of scoring function parameters, always regex_parser
:param parsing_regexes: Regex to extract the answer from generated response
:param aggregation_functions: Aggregation functions to apply to the scores
of each row'
RowsDataSource:
properties:
type:
type: string
const: rows
title: Type
default: rows
rows:
items:
additionalProperties: true
type: object
type: array
title: Rows
type: object
required:
- rows
title: RowsDataSource
description: "A dataset stored in rows.\n:param rows: The dataset is stored\
\ in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"\
content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello,\
\ world!\"}]}\n ]"
SamplingParams:
properties:
strategy:
oneOf:
- $ref: '#/components/schemas/GreedySamplingStrategy'
- $ref: '#/components/schemas/TopPSamplingStrategy'
- $ref: '#/components/schemas/TopKSamplingStrategy'
title: Strategy
discriminator:
propertyName: type
mapping:
greedy: '#/components/schemas/GreedySamplingStrategy'
top_k: '#/components/schemas/TopKSamplingStrategy'
top_p: '#/components/schemas/TopPSamplingStrategy'
max_tokens:
anyOf:
- type: integer
- type: 'null'
title: Max Tokens
repetition_penalty:
anyOf:
- type: number
- type: 'null'
title: Repetition Penalty
default: 1.0
stop:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Stop
type: object
title: SamplingParams
description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n\
:param max_tokens: The maximum number of tokens that can be generated in the\
\ completion. The token count of\n your prompt plus max_tokens cannot exceed\
\ the model's context length.\n:param repetition_penalty: Number between -2.0\
\ and 2.0. Positive values penalize new tokens\n based on whether they\
\ appear in the text so far, increasing the model's likelihood to talk about\
\ new topics.\n:param stop: Up to 4 sequences where the API will stop generating\
\ further tokens.\n The returned text will not contain the stop sequence."
ScoringResult:
properties:
score_rows:
items:
additionalProperties: true
type: object
type: array
title: Score Rows
aggregated_results:
additionalProperties: true
type: object
title: Aggregated Results
type: object
required:
- score_rows
- aggregated_results
title: ScoringResult
description: 'A scoring result for a single row.
:param score_rows: The scoring result for each row. Each row is a map of column
name to value.
:param aggregated_results: Map of metric name to aggregated value'
SystemMessage:
properties:
role:
type: string
const: system
title: Role
default: system
content:
anyOf:
- type: string
- oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
- items:
oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
type: array
title: Content
type: object
required:
- content
title: SystemMessage
description: 'A system message providing instructions or context to the model.
:param role: Must be "system" to identify this as a system message
:param content: The content of the "system prompt". If multiple system messages
are provided, they are concatenated. The underlying Llama Stack code may also
add other system messages (for example, for formatting tool definitions).'
SystemMessageBehavior:
type: string
enum:
- append
- replace
title: SystemMessageBehavior
description: "Config for how to override the default system prompt.\n\n:cvar\
\ append: Appends the provided system message to the default system prompt:\n\
\ https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n\
:cvar replace: Replaces the default system prompt with the provided system\
\ message. The system message can include the string\n '{{function_definitions}}'\
\ to indicate where the function definitions should be inserted."
TextContentItem:
properties:
type:
type: string
const: text
title: Type
default: text
text:
type: string
title: Text
type: object
required:
- text
title: TextContentItem
description: 'A text content item
:param type: Discriminator type of the content item. Always "text"
:param text: Text content'
ToolChoice:
type: string
enum:
- auto
- required
- none
title: ToolChoice
description: 'Whether tool use is required or automatic. This is a hint to the
model which may not be followed. It depends on the Instruction Following capabilities
of the model.
:cvar auto: The model may use tools if it determines that is appropriate.
:cvar required: The model must use tools.
:cvar none: The model must not use tools.'
ToolConfig:
properties:
tool_choice:
anyOf:
- $ref: '#/components/schemas/ToolChoice'
- type: string
- type: 'null'
title: Tool Choice
default: auto
tool_prompt_format:
anyOf:
- $ref: '#/components/schemas/ToolPromptFormat'
- type: 'null'
system_message_behavior:
anyOf:
- $ref: '#/components/schemas/SystemMessageBehavior'
- type: 'null'
default: append
type: object
title: ToolConfig
description: "Configuration for tool use.\n\n:param tool_choice: (Optional)\
\ Whether tool use is automatic, required, or none. Can also specify a tool\
\ name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format:\
\ (Optional) Instructs the model how to format tool calls. By default, Llama\
\ Stack will attempt to use a format that is best adapted to the model.\n\
\ - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n\
\ - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a <function=function_name>\
\ tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as\
\ Python syntax -- a list of function calls.\n:param system_message_behavior:\
\ (Optional) Config for how to override the default system prompt.\n -\
\ `SystemMessageBehavior.append`: Appends the provided system message to the\
\ default system prompt.\n - `SystemMessageBehavior.replace`: Replaces\
\ the default system prompt with the provided system message. The system message\
\ can include the string\n '{{function_definitions}}' to indicate where\
\ the function definitions should be inserted."
ToolDef:
properties:
toolgroup_id:
anyOf:
- type: string
- type: 'null'
title: Toolgroup Id
name:
type: string
title: Name
description:
anyOf:
- type: string
- type: 'null'
title: Description
input_schema:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Input Schema
output_schema:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Output Schema
metadata:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Metadata
type: object
required:
- name
title: ToolDef
description: 'Tool definition used in runtime contexts.
:param name: Name of the tool
:param description: (Optional) Human-readable description of what the tool
does
:param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema)
:param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema)
:param metadata: (Optional) Additional metadata about the tool
:param toolgroup_id: (Optional) ID of the tool group this tool belongs to'
ToolPromptFormat:
type: string
enum:
- json
- function_tag
- python_list
title: ToolPromptFormat
description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json:\
\ JSON format for calling tools. It takes the form:\n {\n \"type\"\
: \"function\",\n \"function\" : {\n \"name\": \"function_name\"\
,\n \"description\": \"function_description\",\n \"\
parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format,\
\ pseudo-XML. This looks like:\n <function=function_name>(parameters)</function>\n\
\n:cvar python_list: Python list. The output is a valid Python expression\
\ that can be\n evaluated to a list. Each element in the list is a function\
\ call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1,\
\ param2)\"]"
ToolResponse:
properties:
call_id:
type: string
title: Call Id
tool_name:
anyOf:
- $ref: '#/components/schemas/BuiltinTool'
- type: string
title: Tool Name
content:
anyOf:
- type: string
- oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
- items:
oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
type: array
title: Content
metadata:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Metadata
type: object
required:
- call_id
- tool_name
- content
title: ToolResponse
description: 'Response from a tool invocation.
:param call_id: Unique identifier for the tool call this response is for
:param tool_name: Name of the tool that was invoked
:param content: The response content from the tool
:param metadata: (Optional) Additional metadata about the tool response'
TopKSamplingStrategy:
properties:
type:
type: string
const: top_k
title: Type
default: top_k
top_k:
type: integer
minimum: 1.0
title: Top K
type: object
required:
- top_k
title: TopKSamplingStrategy
description: 'Top-k sampling strategy that restricts sampling to the k most
likely tokens.
:param type: Must be "top_k" to identify this sampling strategy
:param top_k: Number of top tokens to consider for sampling. Must be at least
1'
TopPSamplingStrategy:
properties:
type:
type: string
const: top_p
title: Type
default: top_p
temperature:
anyOf:
- type: number
minimum: 0.0
- type: 'null'
title: Temperature
top_p:
anyOf:
- type: number
- type: 'null'
title: Top P
default: 0.95
type: object
required:
- temperature
title: TopPSamplingStrategy
description: 'Top-p (nucleus) sampling strategy that samples from the smallest
set of tokens with cumulative probability >= p.
:param type: Must be "top_p" to identify this sampling strategy
:param temperature: Controls randomness in sampling. Higher values increase
randomness
:param top_p: Cumulative probability threshold for nucleus sampling. Defaults
to 0.95'
TrainingConfig:
properties:
n_epochs:
type: integer
title: N Epochs
max_steps_per_epoch:
type: integer
title: Max Steps Per Epoch
default: 1
gradient_accumulation_steps:
type: integer
title: Gradient Accumulation Steps
default: 1
max_validation_steps:
anyOf:
- type: integer
- type: 'null'
title: Max Validation Steps
default: 1
data_config:
anyOf:
- $ref: '#/components/schemas/DataConfig'
- type: 'null'
optimizer_config:
anyOf:
- $ref: '#/components/schemas/OptimizerConfig'
- type: 'null'
efficiency_config:
anyOf:
- $ref: '#/components/schemas/EfficiencyConfig'
- type: 'null'
dtype:
anyOf:
- type: string
- type: 'null'
title: Dtype
default: bf16
type: object
required:
- n_epochs
title: TrainingConfig
description: 'Comprehensive configuration for the training process.
:param n_epochs: Number of training epochs to run
:param max_steps_per_epoch: Maximum number of steps to run per epoch
:param gradient_accumulation_steps: Number of steps to accumulate gradients
before updating
:param max_validation_steps: (Optional) Maximum number of validation steps
per epoch
:param data_config: (Optional) Configuration for data loading and formatting
:param optimizer_config: (Optional) Configuration for the optimization algorithm
:param efficiency_config: (Optional) Configuration for memory and compute
optimizations
:param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)'
URIDataSource:
properties:
type:
type: string
const: uri
title: Type
default: uri
uri:
type: string
title: Uri
type: object
required:
- uri
title: URIDataSource
description: "A dataset that can be obtained from a URI.\n:param uri: The dataset\
\ can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\
\n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\""
URL:
properties:
uri:
type: string
title: Uri
type: object
required:
- uri
title: URL
description: 'A URL reference to external content.
:param uri: The URL string pointing to the resource'
UserMessage:
properties:
role:
type: string
const: user
title: Role
default: user
content:
anyOf:
- type: string
- oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
- items:
oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
type: array
title: Content
context:
anyOf:
- type: string
- oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
- items:
oneOf:
- $ref: '#/components/schemas/ImageContentItem'
- $ref: '#/components/schemas/TextContentItem'
discriminator:
propertyName: type
mapping:
image: '#/components/schemas/ImageContentItem'
text: '#/components/schemas/TextContentItem'
type: array
- type: 'null'
title: Context
type: object
required:
- content
title: UserMessage
description: 'A message from the user in a chat conversation.
:param role: Must be "user" to identify this as a user message
:param content: The content of the message, which can include text and other
media
:param context: (Optional) This field is used internally by Llama Stack to
pass RAG context. This field may be removed in the API in the future.'
_URLOrData:
properties:
url:
anyOf:
- $ref: '#/components/schemas/URL'
- type: 'null'
data:
anyOf:
- type: string
- type: 'null'
contentEncoding: base64
title: Data
type: object
title: _URLOrData
description: 'A URL or a base64 encoded string
:param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}.
Note that URL could have length limits.
:param data: base64 encoded image data as string'
Error:
description: 'Error response from the API. Roughly follows RFC 7807.
:param status: HTTP status code
:param title: Error title, a short summary of the error which is invariant
for an error type
:param detail: Error detail, a longer human-readable description of the error
:param instance: (Optional) A URL which can be used to retrieve more information
about the specific occurrence of the error'
properties:
status:
title: Status
type: integer
title:
title: Title
type: string
detail:
title: Detail
type: string
instance:
anyOf:
- type: string
- type: 'null'
default: null
title: Instance
required:
- status
- title
- detail
title: Error
type: object
responses:
BadRequest400:
description: The request was invalid or malformed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
status: 400
title: Bad Request
detail: The request was invalid or malformed
TooManyRequests429:
description: The client has sent too many requests in a given amount of time
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
status: 429
title: Too Many Requests
detail: You have exceeded the rate limit. Please try again later.
InternalServerError500:
description: The server encountered an unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
status: 500
title: Internal Server Error
detail: An unexpected error occurred
DefaultError:
description: An error occurred
content:
application/json:
schema:
$ref: '#/components/schemas/Error'