---
title: "Sample from a base model with your LoRA weights"
method: POST
path: "/api/v1/asample"
---

# Sample from a base model with your LoRA weights

`POST /api/v1/asample`

Generates samples from the model using the specified sampling parameters

## Request body

- SampleRequest
  - `type` 'sample'
  - `model_path` string — Optional tinker:// path to your model weights or LoRA weights. If not provided, samples against the base model.
  - `base_model` string — Optional base model name to sample from. Is inferred from model_path, if provided. If sampling against a base model, this is required.
  - `prompt` ModelInput, required
    - `chunks` ModelInputChunk[], required — Sequence of input chunks (formerly TokenSequence)
      - union
        - EncodedTextChunk
          - `type` 'encoded_text', required
          - `tokens` integer[], required — Array of token IDs
        - ImageAssetPointerChunk
          - `type` 'image_asset_pointer', required
          - `location` string, required — Path or URL to the image asset
          - `format` 'png' | 'jpeg', required — Image format
          - `width` integer, required — Image width in pixels
          - `height` integer, required — Image height in pixels
          - `tokens` integer, required — Number of tokens this image represents
          - `process_image_function_name` string, required — Name of the function to process this image
  - `sampling_params` SamplingParams, required
    - `max_tokens` integer, nullable — Maximum number of tokens to generate
    - `stop` union — Stop sequences for generation
      - string
      - string[]
      - integer[]
    - `seed` integer, nullable — Random seed for reproducible generation
    - `temperature` number, float — Sampling temperature
    - `top_p` number, float — Nucleus sampling probability
    - `top_k` integer — Top-k sampling parameter (-1 for no limit)
  - `num_samples` integer, required — Number of samples to generate
  - `prompt_logprobs` boolean — If set to `true`, computes and returns logprobs on the prompt tokens. Defaults to false.

## Response `200`

API future for sample completion

- UntypedAPIFuture
  - `request_id` string, uuid, required
  - `model_id` string, uuid

---

[API](https://skmtc.dev/thinking-machines-lab/apis/tinker-api.md) · [All operations](https://skmtc.dev/thinking-machines-lab/apis/tinker-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/thinking-machines-lab/tinker-api/revisions/51afac49fce6/schema)
