inference

generate

Generate text with an inference model.

strata inference generate

wire inference_generate

Runs a text-generation request against a local or cloud model and returns the completion, the reason generation stopped, and the provider-reported prompt and completion token counts. The request controls the maximum completion tokens, sampling temperature, top-k and top-p cutoffs, an optional deterministic seed, string and token-id stop sequences, and an optional GBNF grammar for constrained generation. Chat models expect their chat template already applied in the prompt. Local models require a build with the local execution feature; cloud providers require the matching provider feature and an API key.

To see the complete help for this command, run:

strata inference generate --help

Example

No CLI example in this release.

Parameters

NameTypeRequiredDescription
modelstringyesModel spec.
requestChatRequestyesGeneration request.

Returns

ChatResponse

  • dataChatResponse
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

CodeRetryCommit outcome
failed_precondition.engine.runtime_closednevernot_started
not_found.engine.branchnevernot_applicable
inference.unsupported_operationnevernot_applicable
inference.missing_modelafter_state_changenot_applicable
inference.model_load_failedafter_state_changenot_applicable
inference.local_runtime_failedunknownnot_applicable
inference.missing_api_keyafter_state_changenot_applicable
inference.provider_auth_failedafter_state_changenot_applicable
inference.provider_unavailablesame_requestnot_applicable
inference.provider_timeoutsame_requestnot_applicable
inference.provider_rate_limitedafter_state_changenot_applicable
inference.invalid_requestnevernot_applicable
inference.provider_malformed_responseunknownnot_applicable
inference.unsupported_providernevernot_applicable
inference.unsupported_parameternevernot_applicable
inference.registry_corruptnevernot_applicable
← All 11 Inference commands

agents: this page as markdown → /docs/reference/inference/generate.md