Skip to main content
Version: v0.4.0

Python SDK Reference

Shared Types​

from llama_stack_client.types import (
AgentConfig,
BatchCompletion,
CompletionMessage,
ContentDelta,
Document,
InterleavedContent,
InterleavedContentItem,
Message,
ParamType,
QueryConfig,
QueryResult,
ReturnType,
SafetyViolation,
SamplingParams,
ScoringResult,
SystemMessage,
ToolCall,
ToolParamDefinition,
ToolResponseMessage,
URL,
UserMessage,
)

Toolgroups​

Types:

from llama_stack_client.types import (
ListToolGroupsResponse,
ToolGroup,
ToolgroupListResponse,
)

Methods:

Tools​

Types:

from llama_stack_client.types import ListToolsResponse, Tool, ToolListResponse

Methods:

ToolRuntime​

Types:

from llama_stack_client.types import ToolDef, ToolInvocationResult

Methods:

RagTool​

Methods:

Agents​

Types:

from llama_stack_client.types import (
InferenceStep,
MemoryRetrievalStep,
ShieldCallStep,
ToolExecutionStep,
ToolResponse,
AgentCreateResponse,
)

Methods:

Session​

Types:

from llama_stack_client.types.agents import Session, SessionCreateResponse

Methods:

Steps​

Types:

from llama_stack_client.types.agents import StepRetrieveResponse

Methods:

Turn​

Types:

from llama_stack_client.types.agents import Turn, TurnCreateResponse

Methods:

Datasets​

Types:

from llama_stack_client.types import (
ListDatasetsResponse,
DatasetRetrieveResponse,
DatasetListResponse,
)

Methods:

Eval​

Types:

from llama_stack_client.types import EvaluateResponse, Job

Methods:

Jobs​

Types:

from llama_stack_client.types.eval import JobStatusResponse

Methods:

  • client.eval.jobs.retrieve(job_id, *, benchmark_id) -> EvaluateResponse
  • client.eval.jobs.cancel(job_id, *, benchmark_id) -> None
  • client.eval.jobs.status(job_id, *, benchmark_id) -> Optional[JobStatusResponse]

Inspect​

Types:

from llama_stack_client.types import HealthInfo, ProviderInfo, RouteInfo, VersionInfo

Methods:

Inference​

Types:

from llama_stack_client.types import (
CompletionResponse,
EmbeddingsResponse,
TokenLogProbs,
InferenceChatCompletionResponse,
InferenceCompletionResponse,
)

Methods:

VectorIo​

DEPRECATED API

This API is deprecated and will be removed in a future version.

Use the OpenAI-compatible Vector Stores API instead:

  • Instead of client.vector_io.insert(), use client.vector_stores.files.create() and client.vector_stores.files.chunks.create()
  • Instead of client.vector_io.query(), use client.vector_stores.search()

See the RAG documentation for migration examples.

Related: Issue #2981

Types:

from llama_stack_client.types import QueryChunksResponse

Methods:

VectorDBs​

DEPRECATED API

This API is deprecated and will be removed in a future version.

Use the OpenAI-compatible Vector Stores API instead:

  • Instead of client.vector_dbs.register(), use client.vector_stores.create()
  • Instead of client.vector_dbs.list(), use client.vector_stores.list()
  • Instead of client.vector_dbs.retrieve(), use client.vector_stores.retrieve()
  • Instead of client.vector_dbs.unregister(), use client.vector_stores.delete()

See the RAG documentation for migration examples.

Related: Issue #2981

Types:

from llama_stack_client.types import (
ListVectorDBsResponse,
VectorDBRetrieveResponse,
VectorDBListResponse,
VectorDBRegisterResponse,
)

Methods:

Models​

Types:

from llama_stack_client.types import ListModelsResponse, Model, ModelListResponse

Methods:

PostTraining​

Types:

from llama_stack_client.types import ListPostTrainingJobsResponse, PostTrainingJob

Methods:

Job​

Types:

from llama_stack_client.types.post_training import (
JobListResponse,
JobArtifactsResponse,
JobStatusResponse,
)

Methods:

Providers​

Types:

from llama_stack_client.types import ListProvidersResponse, ProviderListResponse

Methods:

Routes​

Types:

from llama_stack_client.types import ListRoutesResponse, RouteListResponse

Methods:

Safety​

Types:

from llama_stack_client.types import RunShieldResponse

Methods:

Shields​

Types:

from llama_stack_client.types import ListShieldsResponse, Shield, ShieldListResponse

Methods:

SyntheticDataGeneration​

Types:

from llama_stack_client.types import SyntheticDataGenerationResponse

Methods:

Datasetio​

Types:

from llama_stack_client.types import PaginatedRowsResult

Methods:

Scoring​

Types:

from llama_stack_client.types import ScoringScoreResponse, ScoringScoreBatchResponse

Methods:

ScoringFunctions​

Types:

from llama_stack_client.types import (
ListScoringFunctionsResponse,
ScoringFn,
ScoringFunctionListResponse,
)

Methods:

Benchmarks​

Types:

from llama_stack_client.types import (
Benchmark,
ListBenchmarksResponse,
BenchmarkListResponse,
)

Methods: