NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #3240 most downloaded on PyPI
The official Python SDK for the tinker API
Latest stable
0.40.1
Last release 8 days ago
25 Nov 2026
Ships on a steady schedule
a new release about every 9 days
Most releases are documented
notes for 45 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
81 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Resolves hostnames using the operating system's DNS resolver across all HTTP requests.
Published November 25, 2026
Experimental: RestClient.external_weights_upload_start() returns an UploadURL per file instead of a string. Upload each file with UploadURL.upload(pat
Published November 23, 2026
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Log a warning if user code cancels a sampling request and retries the same request. The SDK already handles retries automatically. If a request is tak
Published November 18, 2026
RestClient.search_sessions() parses session-level failures as SessionFailedSessionReason instead of failing response validation.
Published November 16, 2026
RestClient.search_sessions() parses session-level failures as SessionFailedSessionReason instead of failing response validation.
RestClient.search_sessions() , RestClient.get_billing_usage() , and AdminClient.get_billing_usage() return unrecognized session statuses, failure and finish reasons, and billing events as UnrecognizedType instead of failing response validation. The original data is available in raw_object .
Corrects tokenizer-loading failures in get_tokenizer() for moonshotai/Kimi-K3.1-Pro .
Experimental: call RestClient.external_weights_upload_start(base_model=..., lora_config=..., destination_project_id=...) , PUT every file to its retur
Published November 6, 2026
Experimental: call RestClient.external_weights_upload_start(base_model=..., lora_config=..., destination_project_id=...) , PUT every file to its returned signed URL, and call external_weights_upload_finish(upload_id) . The files must match the format exported by save_weights_external() for that base model and LoRA configuration. The completed upload returns a checkpoint path; upload support is gated by the server.
Experimental: call RestClient.search_checkpoints(CheckpointSearchRequest(...)) to list matching checkpoints newest first. Filter by project_ids , user_metadata , checkpoint_type , owner , or base_models , and page with next_cursor . Results are limited to projects you can list, and the default owner filter selects your own checkpoints.
Read Checkpoint.base_model to get the base model a checkpoint was trained from. It is None when the server does not send it.
Resolve them with await or .result() before using the clients; using the compatibility wrapper directly still works with a deprecation warning.
Published November 5, 2026
Use APIFuture.future() when passing an operation to concurrent.futures.wait , as_completed , or callbacks. Use .coroutine() with APIs requiring a coroutine, for example asyncio.create_task(client.sample(...).coroutine()) .
Call RestClient.get_server_capabilities() to list the supported models without creating a session.
SamplingClient.sample() and compute_logprobs() return APIFuture objects. Use await client.sample(...) in async code or client.sample(...).result() in sync code.
ServiceClient.create_lora_training_client() , create_training_client_from_state() , create_training_client_from_state_with_optimizer() , create_sampling_client() , TrainingClient.create_sampling_client() , and save_weights_and_get_sampling_client() return futures of clients. Resolve them with await or .result() before using the clients; using the compatibility wrapper directly still works with a deprecation warning.
TrainingClient.get_info() and SamplingClient.get_base_model() return information already stored on the client, without a network call.
Raises RuntimeError when a blocking SDK call, such as .result() on a pending future, runs on the SDK's own event loop, for example inside a done-callback. Before, the call logged a warning and never returned.
Points deprecation warnings at the user call site instead of SDK wrappers.
The _async methods on service, training, sampling, REST, and admin clients are deprecated. Await the corresponding unsuffixed method instead. For training operations that previously required two awaits, replace f = await client.forward_backward_async(...); result = await f.result_async() with result = await client.forward_backward(...) . No removal version or date is specified.
Using a client-creation future directly as a training or sampling client is deprecated. Add .result() in synchronous code or await in asynchronous code; the compatibility behavior remains available in this release, with no removal version or date specified.
Calling standard concurrent.futures.Future methods directly on sampling futures is deprecated. Use .future() first, for example client.sample(...).future().add_done_callback(callback) . Sampling compatibility remains available in this release.
ServiceClient.get_server_capabilities() and its async variant are deprecated. Use RestClient.get_server_capabilities() and resolve its future; no removal version or date is specified.
REST and admin operations now return awaitable APIFuture objects instead of concurrent.futures.Future objects. Callers using .done() , .add_done_callback() , wait , or as_completed must first call .future() : replace rest_client.list_sessions().add_done_callback(cb) with rest_client.list_sessions().future().add_done_callback(cb) . Plain .result() callers continue to work.
The experimental RestClient.search_sessions_async() method is removed. Replace await rest_client.search_sessions_async(request) with await rest_client.search_sessions(request) .
The client-creation methods return before the client exists. An error such as a bad checkpoint path now raises at .result() , at await , or at the first call on the client, not inside the creation call. To handle the error at creation, call .result() inside your try block: training_client = service_client.create_training_client_from_state(path).result() .
Call save_weights_and_get_sampling_client(kind="inflight") to publish mutable weights shared by that training model's inflight clients. Each returned
Published November 2, 2026
Call save_weights_and_get_sampling_client(kind="inflight") to publish mutable weights shared by that training model's inflight clients. Each returned client has a fresh KV-cache namespace and uses the just-published weights or newer; existing clients adopt updates asynchronously. Active generations can span updates. The default kind="snapshot" still keeps fixed weights.
Read StorageBillingEvent.free to distinguish free storage from paid storage in billing usage responses. Older responses without the field default to False .
forward_backward_custom() returns its future at once. It no longer waits for the forward pass and the local loss. Requests still run in submission order, so you can call optim_step() right after it.
Capacity-pause messages are emitted only after the pause has lasted 15 minutes, reducing warnings for short periods spent waiting for capacity.
An expired JWT credential, from api_key , TINKER_API_KEY or TINKER_CREDENTIAL_CMD , now raises a local TinkerError , and the SDK sends no request. Before, the server rejected it with AuthenticationError . A JWT credential without an exp claim raises ValueError .
Prevents a slow custom loss from delaying session heartbeats and other API calls.
Recovers when the server rejects the SDK's short-lived session token as expired or signed with a retired key: the SDK gets a new token and sends the request again once. Concurrent rejections share one new token.
Surfaces credential rejection during token exchange instead of continuing to use a cached JWT.
Refreshes the session token in time when the local clock runs behind the server's. Before, a clock more than five minutes behind made requests fail with AuthenticationError near the end of each token's lifetime.
Page through results with next_cursor . Experimental APIs emit tinker.ExperimentalWarning and may change without a deprecation period.
Published October 25, 2026
Alpha: call ServiceClient.create_custom_loss(fn, input_ranks=...).result() to create a session-scoped LossHandle , then pass it to TrainingClient.forward_backward_custom() . The function receives logprobs and named tensor inputs per datum and returns a scalar loss plus scalar metrics. It must satisfy the documented torch tracing constraints. When the server enables it for your organization, the loss runs on the server in one request; otherwise it runs locally.
Construct tinker.RestClient(base_url=..., api_key=...) directly for REST operations. It needs no ServiceClient , creates no server session, and shares connections with clients using the same configuration.
Use tinker.AdminClient() for get_billing_usage() , get_current_checkpoint_storage_usage() , and get_audit_log() . get_billing_usage() and get_current_checkpoint_storage_usage() require the admin or billing-admin role; get_audit_log() requires the admin role.
Experimental: search sessions with RestClient.search_sessions(SessionSearchRequest(...)) , using project, owner, metadata, display-name, and status filters. Page through results with next_cursor . Experimental APIs emit tinker.ExperimentalWarning and may change without a deprecation period.
TrainingClient.load_state*() is deprecated. Create a new client using ServiceClient.create_training_client_from_state() or create_training_client_from_state_with_optimizer() instead. Removal is announced for a future SDK release without a version or date.
ServiceClient.create_rest_client() is deprecated; construct tinker.RestClient() directly with the appropriate URL and credentials. Removal is announced for a future release without a version or date.
Billing, current-storage, and audit-log methods on RestClient are deprecated in favor of the corresponding AdminClient methods. Their async variants are also deprecated on RestClient ; no removal version or date is specified.
The loss_type_input parameter of forward_backward_custom() and its async variant is deprecated because custom losses always receive logprobs. Remove the argument; no removal version or date is specified.
All RestClient.get_checkpoint_archive_url*() variants and CheckpointArchiveUrlResponse are removed. Export weights with TrainingClient.save_weights_external() , then get one URL for each file with RestClient.get_external_weights_urls() .
tinker checkpoint download and tinker checkpoint push-hf no longer accept sampler checkpoint paths ( tinker://<run-id>/sampler_weights/<name> ). Pass a training checkpoint ( tinker://<run-id>/weights/<name> ) or an external weights path ( tinker://<run-id>/external_weights/<name> ). A training checkpoint download starts a temporary training session, exports the weights, and deletes the export afterwards. Encrypted files keep .age ; decrypt encrypted adapters before Hugging Face upload.
Use loss_fn="stable_reinforce" for StableReinforce training. Create sampling clients with record_stability_info=True when recording the sequence stabi
Published October 21, 2026
Use loss_fn="stable_reinforce" for StableReinforce training. Create sampling clients with record_stability_info=True when recording the sequence stability information required by that workflow; the recorded information is session-scoped and expires after inactivity.
Import the shared provenance-span type as tinker.types.ProvenanceSpans when constructing or annotating datum provenance.
Server-sent deprecation notices are now logged at the warning or error level indicated by the response.
Published October 16, 2026
Pass loss_fn="gspo" to training calls; sequence_ratio_mask is recognized as a float32 loss input.
Set ServiceClient(display_name=...) to give the session a human-readable name. Session responses include that name; it need not be unique.
Run tinker model list [substring] to list the models available to your organization, including context limits and whether each model can train or sample. The optional name filter is case-insensitive.
Run tinker auth whoami to display the active credential's email, user URN, and organization URN. RestClient.whoami().result().org_urn also returns the organization URN.
Use RestClient.copy_weights(path, destination_project_id=..., ttl_seconds=..., weights_access_token=...) to copy a checkpoint into a selected project. The copy preserves its checkpoint kind and shares storage with the source. It belongs to a new training run that cannot itself be trained on.
Sends one idempotency key for all retries of a copy_weights() call, so a retry does not create a second copy.
Excludes cross-account checkpoint-copy credentials from debug logs.
RestClient.get_checkpoint_archive_url*() is deprecated, including async and Tinker-path variants. Export with TrainingClient.save_weights_external() a…
Published October 8, 2026
Use prompt_logprobs_last_n=N with SamplingClient.sample(..., include_prompt_logprobs=True) or compute_logprobs(...) to score the last N prompt tokens.
Published October 8, 2026
Use prompt_logprobs_last_n=N with SamplingClient.sample(..., include_prompt_logprobs=True) or compute_logprobs(...) to score the last N prompt tokens. Earlier entries are None ; N must be between 1 and len(prompt) - 1 . This also limits top-k prompt logprobs, but does not affect target-token scoring or alternative prompt-token draws.
Pass age_encryption_recipients=[...] to TrainingClient.save_weights_external() to encrypt each exported file to up to 10 age or SSH recipients. Exported files have a .age suffix; decrypt them with age -d -i <identity> . Omitting the argument keeps exports unencrypted.
Call RestClient.get_current_checkpoint_storage_usage(project_id=...) or tinker billing checkpoint-storage --project-id ... --csv ... to report checkpo
Published October 2, 2026
Call RestClient.get_current_checkpoint_storage_usage(project_id=...) or tinker billing checkpoint-storage --project-id ... --csv ... to report checkpoint counts, sizes, and projected costs grouped by project and owner. The project filter is optional; data may lag by 1–2 hours, and costs are gross 720-hour projections rather than invoices.
Pass SamplingClient.get_sampler_handle() to another process and reconstruct it with SamplingClient.from_sampler_handle(handle, api_key=...) . The receiving process resolves its credentials; the handle is the pickle-free alternative to serializing the client.
Custom losses can consume additional tensors in Datum.loss_fn_inputs , which previously raised ValueError . Only target_tokens and weights are sent for the server forward pass; other fields remain available to the local loss function.
Sends requests from an unpickled SamplingClient to the parent's server when the parent set it with TINKER_BASE_URL . Before, a worker without that variable used the default server.
Raises an error on the first request when TINKER_CREDENTIAL_CMD fails or prints nothing. Before, the SDK retried it as a connection error and raised APIConnectionError after about six minutes.
Set prompt_alt_tokens_k=k on SamplingClient.sample() to draw alternatives at each prompt position after the first. Read SampleResponse.prompt_alt_toke
Published September 29, 2026
Use the restored public DimuonOptimizerConfig and DimuonParams to configure Dimuon requests in the SDK. Execution requires server enablement.
Published September 25, 2026
DimuonOptimizerConfig and DimuonParams are removed from the public API. If you use Dimuon, remain on 0.30.2 until a release restores public support. A
Published September 25, 2026
Use RestClient.get_billing_usage() or tinker billing usage --csv to read estimated USD usage costs and effective token or storage rates. cost_data_thr
Published September 24, 2026
Reports the custom loss in forward_backward_custom() metrics under loss:sum , rather than the surrogate loss. The previous value is available under su
Published September 22, 2026
Reports the custom loss in forward_backward_custom() metrics under loss:sum , rather than the surrogate loss. The previous value is available under surrogate_loss:sum ; this changes metrics recorded by custom-loss training runs.
Suppresses PyTorch’s sparse-CSR beta warning during tensor conversions.
Pass target_prompt_logprobs to SamplingClient.sample() to score selected token IDs at prompt positions. Supply an int64 TensorData with shape [len(pro
Published September 18, 2026
Pass target_prompt_logprobs to SamplingClient.sample() to score selected token IDs at prompt positions. Supply an int64 TensorData with shape [len(prompt) - 1, K] , using -1 for unused cells, and read SampleResponse.target_prompt_logprobs .
Use an integer pad_value with TensorData.from_torch_sparse() , .to_numpy() , .to_torch() , or .tolist() to represent omitted sparse entries with a value other than zero, such as -1 .
Use RestClient.get_session(session_id) to retrieve the session’s custom metadata in GetSessionResponse.user_metadata .
Use with tinker.ServiceClient() as client: to close a session automatically. Normal completion marks it successful, an exception marks it errored, and
Published September 17, 2026
Use with tinker.ServiceClient() as client: to close a session automatically. Normal completion marks it successful, an exception marks it errored, and an interruption marks it interrupted.
Use optimizer=types.DimuonOptimizerConfig() and optim_step(types.DimuonParams(learning_rate=...)) to configure the SDK’s Dimuon requests. Execution requires server enablement. Existing Adam calls, including optim_step(adam_params=...) , still work.
Pass topk_sample_logprobs=k to SamplingClient.sample() to return the top token alternatives at each generated position. Read each sequence’s .topk_log
Published September 14, 2026
RestClient.get_external_weights_urls() now accepts one Tinker path instead of a training-run ID and checkpoint ID. Replace rest_client.get_external_we
Published September 9, 2026
Call TrainingClient.save_weights_external(name) to request an external-weight checkpoint. The SDK adds RestClient.get_external_weights_urls(training_r
Published September 9, 2026
Call ServiceClient.close(status, detail=None) to finish a session with status "success" , "errored" , or "interrupted" . Await the returned future or
Published September 8, 2026
Pass user_metadata to save_state() or save_weights_for_sampler() to attach custom metadata to a checkpoint. Overwriting a state checkpoint replaces it
Published September 3, 2026
Pass user_metadata to save_state() or save_weights_for_sampler() to attach custom metadata to a checkpoint. Overwriting a state checkpoint replaces its metadata; omitting user_metadata clears the previous values.
Call get_console_url() on service and training clients or checkpoint-save responses to open them in the console. Call get_playground_url() on a sampler-checkpoint response to open the saved model in the playground.
Pass stop=[] in SamplingParams to disable implicit end-of-sequence stopping and sample until max_tokens .
Published August 31, 2026 ### New - None. ### Changes - None. ### Fixed - None. ### Deprecations - None. ### Breaking changes - None. ### Dependencies
Published August 31, 2026
AuditLogEntry.model_id , .tinker_path , and .purpose are deprecated. Read the corresponding values from .event_details instead. No removal version or…
Published August 31, 2026
Pass string values as well as numbers in loss_fn_config when calling forward() or forward_backward() .
Call ServiceClient.copy_weights() to copy a checkpoint into the client’s project. Await the returned future, or call .result() , to get the new checkpoint path.
Use RestClient.get_audit_log(event_type="projects") , "teams" , or "organizations" to retrieve administrative audit events. Read AuditLogEntry.event_details for their full details.
Use Checkpoint.user_metadata to read custom metadata returned with a checkpoint.
Returns the stored static API key from get_tinker_token() even when TINKER_CREDENTIAL_CMD is configured, without executing the credential command.
Published August 25, 2026
Use tinker auth login to sign in through a browser and save credentials for future SDK and CLI sessions. Use tinker auth status to check access and ti
Published August 25, 2026
Use tinker auth login to sign in through a browser and save credentials for future SDK and CLI sessions. Use tinker auth status to check access and tinker auth logout to sign out.
Call tinker.get_tinker_token() to retrieve a static API key, tinker.tinker_has_credentials() to check whether credentials are configured, or tinker.raise_if_tinker_not_accessible() to check server access. Payment-required responses raise BillingError .
Use Datum.with_provenance() with PromptProvenanceSpan and SampledProvenanceSpan to identify the prompt and sampled tokens in training data. Sampling results include SampledSequence.sequence_id for linking sampled spans.
Use SupportedModel.trainable and .sampleable from server capabilities to check which operations a model supports. Either field can be None when the server does not report it.
Corrects training batch sizing for dense and sparse tensors, avoiding unnecessary request splitting and accounting for sparse indices.
Published August 7, 2026
Preserves each example's tensor shape and dtype in forward/backward results when loss outputs have different shapes or dtypes. Previously, later examp
Published August 6, 2026
Run tinker session export-trace SESSION_ID to download a session's training and sampling timeline as a Perfetto trace. Use --output PATH for a custom
Published July 28, 2026
Call RestClient.get_billing_usage(starting_on, ending_before) or run tinker billing usage STARTING_ON ENDING_BEFORE to inspect hourly usage. Requires
Published July 24, 2026
Trusts operating-system certificate authorities when using pyqwest, fixing UnknownIssuer errors behind TLS-inspecting proxies and VPNs.
Published July 21, 2026
Call RestClient.whoami().result() to get the credential's user URN and email; service identities can have no email. JWT authentication must be enabled
Published July 21, 2026
Follows audit-log download redirects without failing with a reset HTTP stream.
Published July 17, 2026
Use DmelChunk(dmel=...) to include serialized DMel tensors in ModelInput . Its length property reads the token count from the tensor.
Published July 15, 2026
Use DmelChunk(dmel=...) to include serialized DMel tensors in ModelInput . Its length property reads the token count from the tensor.
Read SampleResponse.prompt_cache_hit_tokens for the number of prompt tokens billed as prefix-cache hits. The count refers to the shared prompt and is not multiplied by num_samples .
Uses the supplied weights_access_token correctly when loading checkpoint weights through ServiceClient.create_training_client_from_state() .
Published June 30, 2026
Pass project_id to RestClient.list_training_runs() to list only runs in that project.
Published June 25, 2026
Set TINKER_PROJECT_ID to select the project used by ServiceClient() when no project_id argument is supplied.
Published June 23, 2026
Pass RetryConfig(enable_stuck_detection=False) when creating a sampling client to disable the no-progress timeout. Requests can then wait indefinitely
Published May 30, 2026
Follows checkpoint download redirects without failing with a reset HTTP stream.
Published May 27, 2026
Retries temporary failures when requesting a checkpoint download URL.
Published May 26, 2026
Use RestClient.assign_session_project(session_id, project_id) to move a session and its training runs and samplers into a project. Sessions can move b
Published May 22, 2026
Copies read-only NumPy arrays when constructing TensorData , avoiding warnings and unsafe writes when converting them to PyTorch tensors.
Suppresses spurious telemetry warnings during sampling.
Updates the tokenizer revision used for Kimi-K2.6.
Published May 18, 2026
Refreshes expiring authentication tokens before sending a request, preventing authentication failures after a delayed background refresh.
Reuses sampling request IDs across submission retries, preventing a retry from being treated as a new sampling request.
Back to top
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per month.