跳转至

Tinker-compatible API

MinT is a drop-in for the Tinker SDK

The MinT client exposes the same public surface as the Tinker SDK. Install MinT, then alias the import — every type, client, and method documented on the pages below works unchanged:

pip install git+https://github.com/MindLab-Research/mindlab-toolkit.git
import mint as tinker   # use tinker.ServiceClient, tinker.types.Datum, ...

Set your MinT credentials (a Tinker key prefix also works via the compatibility patches applied on import):

export MINT_API_KEY=sk-your-api-key-here
export MINT_BASE_URL=https://mint.macaron.im/        # mainland China: mintcn.macaron.xin

The reference below lists every public type and client in the SDK, organised by module. These are the Tinker-compatible types; call them through import mint as tinker or directly through import mint.

  • ServiceClient — main entry point; create training, sampling, and REST clients.
  • TrainingClient — LoRA training loop (forward_backward, optim_step, save weights).
  • SamplingClient — token sampling and log-probabilities.
  • RestClient — REST operations (list weights, billing usage).
  • APIFuture — the async future returned by all SDK calls.
  • Types — Datum, ModelInput, SamplingParams, AdamParams, LoRAConfig, and the rest.
  • Exceptions — error hierarchy raised by SDK calls.

Attribution

The API reference in this section is derived from the Tinker SDK, which is licensed under the Apache License, Version 2.0.

  • Copyright: Copyright (c) Thinking Machines Lab and contributors.
  • License: Apache License 2.0 — a copy is included at /licenses/APACHE-2.0.txt.
  • Modifications: The reference has been adapted for MinT (module and class identifiers renamed, MinT-specific endpoints and credentials documented); the underlying type and method signatures are unchanged.

This satisfies the Apache 2.0 redistribution requirements (license copy, copyright notice, and modification statement).