v1

latestOpenAPI 3.0.3raw.githubusercontent.com2025-07-15155231.4 KB

Sample from a base model with your LoRA weights

Generates samples from the model using the specified sampling parameters

post/api/v1/sample

Request body

type'sample'
model_pathstring

Optional tinker:// path to your model weights or LoRA weights. If not provided, samples against the base model.

base_modelstring

Optional base model name to sample from. Is inferred from model_path, if provided. If sampling against a base model, this is required.

num_samplesinteger required

Number of samples to generate

prompt_logprobsboolean

If set to true, computes and returns logprobs on the prompt tokens. Defaults to false.

Example request

{
  "prompt": {
    "chunks": [
      {
        "tokens": [
          1234,
          5678,
          9012
        ]
      }
    ]
  }
}

Response

Response containing tokens sampled against the base model and lora

type'sample' required