Sync contents

This commit is contained in:
Daniel Xu 2025-11-25 06:15:14 +00:00
parent 937c36e9b1
commit 9bf0df6796
9 changed files with 5 additions and 179 deletions

View file

@ -1,4 +1,4 @@
{ {
"last_synced_sha": "110dad99af8ae1062af4fa99fc7559104d793680", "last_synced_sha": "fb89303330ff94edcbd16cf47d253d7242225ba6",
"last_sync_time": "2025-11-25T05:55:10.370139" "last_sync_time": "2025-11-25T06:15:14.524561"
} }

View file

@ -1,5 +1,3 @@
# `tinker.lib.public_interfaces.api_future`
API Future classes for handling async operations with retry logic. API Future classes for handling async operations with retry logic.
## `APIFuture` Objects ## `APIFuture` Objects
@ -41,7 +39,6 @@ result = future.result()
#### `result_async` #### `result_async`
```python ```python
@abstractmethod
async def result_async(timeout: float | None = None) -> T async def result_async(timeout: float | None = None) -> T
``` ```
@ -59,7 +56,6 @@ Raises:
#### `result` #### `result`
```python ```python
@abstractmethod
def result(timeout: float | None = None) -> T def result(timeout: float | None = None) -> T
``` ```

View file

@ -1,5 +1,3 @@
# `tinker._exceptions`
## `TinkerError` Objects ## `TinkerError` Objects
```python ```python

View file

@ -1,5 +1,3 @@
# `tinker.lib.public_interfaces.rest_client`
RestClient for Tinker API REST operations. RestClient for Tinker API REST operations.
## `RestClient` Objects ## `RestClient` Objects
@ -40,8 +38,6 @@ for checkpoint in checkpoints.checkpoints:
#### `get_training_run` #### `get_training_run`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_training_run( def get_training_run(
training_run_id: types.ModelID) -> ConcurrentFuture[types.TrainingRun] training_run_id: types.ModelID) -> ConcurrentFuture[types.TrainingRun]
``` ```
@ -64,7 +60,6 @@ print(f"Training Run ID: {response.training_run_id}, Base: {response.base_model}
#### `get_training_run_async` #### `get_training_run_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_training_run_async( async def get_training_run_async(
training_run_id: types.ModelID) -> types.TrainingRun training_run_id: types.ModelID) -> types.TrainingRun
``` ```
@ -74,8 +69,6 @@ Async version of get_training_run.
#### `get_training_run_by_tinker_path` #### `get_training_run_by_tinker_path`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_training_run_by_tinker_path( def get_training_run_by_tinker_path(
tinker_path: str) -> ConcurrentFuture[types.TrainingRun] tinker_path: str) -> ConcurrentFuture[types.TrainingRun]
``` ```
@ -98,7 +91,6 @@ print(f"Training Run ID: {response.training_run_id}, Base: {response.base_model}
#### `get_training_run_by_tinker_path_async` #### `get_training_run_by_tinker_path_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_training_run_by_tinker_path_async( async def get_training_run_by_tinker_path_async(
tinker_path: str) -> types.TrainingRun tinker_path: str) -> types.TrainingRun
``` ```
@ -108,7 +100,6 @@ Async version of get_training_run_by_tinker_path.
#### `get_weights_info_by_tinker_path` #### `get_weights_info_by_tinker_path`
```python ```python
@capture_exceptions(fatal=True)
def get_weights_info_by_tinker_path( def get_weights_info_by_tinker_path(
tinker_path: str) -> APIFuture[types.WeightsInfoResponse] tinker_path: str) -> APIFuture[types.WeightsInfoResponse]
``` ```
@ -131,8 +122,6 @@ print(f"Base Model: {response.base_model}, LoRA Rank: {response.lora_rank}")
#### `list_training_runs` #### `list_training_runs`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def list_training_runs( def list_training_runs(
limit: int = 20, limit: int = 20,
offset: int = 0) -> ConcurrentFuture[types.TrainingRunsResponse] offset: int = 0) -> ConcurrentFuture[types.TrainingRunsResponse]
@ -160,7 +149,6 @@ next_page = rest_client.list_training_runs(limit=50, offset=50)
#### `list_training_runs_async` #### `list_training_runs_async`
```python ```python
@capture_exceptions(fatal=True)
async def list_training_runs_async(limit: int = 20, async def list_training_runs_async(limit: int = 20,
offset: int = 0 offset: int = 0
) -> types.TrainingRunsResponse ) -> types.TrainingRunsResponse
@ -171,8 +159,6 @@ Async version of list_training_runs.
#### `list_checkpoints` #### `list_checkpoints`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def list_checkpoints( def list_checkpoints(
training_run_id: types.ModelID training_run_id: types.ModelID
) -> ConcurrentFuture[types.CheckpointsListResponse] ) -> ConcurrentFuture[types.CheckpointsListResponse]
@ -200,7 +186,6 @@ for checkpoint in response.checkpoints:
#### `list_checkpoints_async` #### `list_checkpoints_async`
```python ```python
@capture_exceptions(fatal=True)
async def list_checkpoints_async( async def list_checkpoints_async(
training_run_id: types.ModelID) -> types.CheckpointsListResponse training_run_id: types.ModelID) -> types.CheckpointsListResponse
``` ```
@ -210,8 +195,6 @@ Async version of list_checkpoints.
#### `get_checkpoint_archive_url` #### `get_checkpoint_archive_url`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_checkpoint_archive_url( def get_checkpoint_archive_url(
training_run_id: types.ModelID, checkpoint_id: str training_run_id: types.ModelID, checkpoint_id: str
) -> ConcurrentFuture[types.CheckpointArchiveUrlResponse] ) -> ConcurrentFuture[types.CheckpointArchiveUrlResponse]
@ -238,7 +221,6 @@ print(f"Expires at: {response.expires_at}")
#### `get_checkpoint_archive_url_async` #### `get_checkpoint_archive_url_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_checkpoint_archive_url_async( async def get_checkpoint_archive_url_async(
training_run_id: types.ModelID, training_run_id: types.ModelID,
checkpoint_id: str) -> types.CheckpointArchiveUrlResponse checkpoint_id: str) -> types.CheckpointArchiveUrlResponse
@ -249,8 +231,6 @@ Async version of get_checkpoint_archive_url.
#### `delete_checkpoint` #### `delete_checkpoint`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def delete_checkpoint(training_run_id: types.ModelID, def delete_checkpoint(training_run_id: types.ModelID,
checkpoint_id: str) -> ConcurrentFuture[None] checkpoint_id: str) -> ConcurrentFuture[None]
``` ```
@ -260,7 +240,6 @@ Delete a checkpoint for a training run.
#### `delete_checkpoint_async` #### `delete_checkpoint_async`
```python ```python
@capture_exceptions(fatal=True)
async def delete_checkpoint_async(training_run_id: types.ModelID, async def delete_checkpoint_async(training_run_id: types.ModelID,
checkpoint_id: str) -> None checkpoint_id: str) -> None
``` ```
@ -270,8 +249,6 @@ Async version of delete_checkpoint.
#### `delete_checkpoint_from_tinker_path` #### `delete_checkpoint_from_tinker_path`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def delete_checkpoint_from_tinker_path( def delete_checkpoint_from_tinker_path(
tinker_path: str) -> ConcurrentFuture[None] tinker_path: str) -> ConcurrentFuture[None]
``` ```
@ -281,7 +258,6 @@ Delete a checkpoint referenced by a tinker path.
#### `delete_checkpoint_from_tinker_path_async` #### `delete_checkpoint_from_tinker_path_async`
```python ```python
@capture_exceptions(fatal=True)
async def delete_checkpoint_from_tinker_path_async(tinker_path: str) -> None async def delete_checkpoint_from_tinker_path_async(tinker_path: str) -> None
``` ```
@ -290,8 +266,6 @@ Async version of delete_checkpoint_from_tinker_path.
#### `get_checkpoint_archive_url_from_tinker_path` #### `get_checkpoint_archive_url_from_tinker_path`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_checkpoint_archive_url_from_tinker_path( def get_checkpoint_archive_url_from_tinker_path(
tinker_path: str tinker_path: str
) -> ConcurrentFuture[types.CheckpointArchiveUrlResponse] ) -> ConcurrentFuture[types.CheckpointArchiveUrlResponse]
@ -308,7 +282,6 @@ Returns:
#### `get_checkpoint_archive_url_from_tinker_path_async` #### `get_checkpoint_archive_url_from_tinker_path_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_checkpoint_archive_url_from_tinker_path_async( async def get_checkpoint_archive_url_from_tinker_path_async(
tinker_path: str) -> types.CheckpointArchiveUrlResponse tinker_path: str) -> types.CheckpointArchiveUrlResponse
``` ```
@ -318,8 +291,6 @@ Async version of get_checkpoint_archive_url_from_tinker_path.
#### `publish_checkpoint_from_tinker_path` #### `publish_checkpoint_from_tinker_path`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def publish_checkpoint_from_tinker_path( def publish_checkpoint_from_tinker_path(
tinker_path: str) -> ConcurrentFuture[None] tinker_path: str) -> ConcurrentFuture[None]
``` ```
@ -351,7 +322,6 @@ print("Checkpoint published successfully")
#### `publish_checkpoint_from_tinker_path_async` #### `publish_checkpoint_from_tinker_path_async`
```python ```python
@capture_exceptions(fatal=True)
async def publish_checkpoint_from_tinker_path_async(tinker_path: str) -> None async def publish_checkpoint_from_tinker_path_async(tinker_path: str) -> None
``` ```
@ -360,8 +330,6 @@ Async version of publish_checkpoint_from_tinker_path.
#### `unpublish_checkpoint_from_tinker_path` #### `unpublish_checkpoint_from_tinker_path`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def unpublish_checkpoint_from_tinker_path( def unpublish_checkpoint_from_tinker_path(
tinker_path: str) -> ConcurrentFuture[None] tinker_path: str) -> ConcurrentFuture[None]
``` ```
@ -393,7 +361,6 @@ print("Checkpoint unpublished successfully")
#### `unpublish_checkpoint_from_tinker_path_async` #### `unpublish_checkpoint_from_tinker_path_async`
```python ```python
@capture_exceptions(fatal=True)
async def unpublish_checkpoint_from_tinker_path_async( async def unpublish_checkpoint_from_tinker_path_async(
tinker_path: str) -> None tinker_path: str) -> None
``` ```
@ -403,8 +370,6 @@ Async version of unpublish_checkpoint_from_tinker_path.
#### `list_user_checkpoints` #### `list_user_checkpoints`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def list_user_checkpoints( def list_user_checkpoints(
limit: int = 100, limit: int = 100,
offset: int = 0) -> ConcurrentFuture[types.CheckpointsListResponse] offset: int = 0) -> ConcurrentFuture[types.CheckpointsListResponse]
@ -439,7 +404,6 @@ if response.cursor and response.cursor.offset + response.cursor.limit < response
#### `list_user_checkpoints_async` #### `list_user_checkpoints_async`
```python ```python
@capture_exceptions(fatal=True)
async def list_user_checkpoints_async(limit: int = 100, async def list_user_checkpoints_async(limit: int = 100,
offset: int = 0 offset: int = 0
) -> types.CheckpointsListResponse ) -> types.CheckpointsListResponse
@ -450,8 +414,6 @@ Async version of list_user_checkpoints.
#### `get_session` #### `get_session`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_session(session_id: str) -> ConcurrentFuture[types.GetSessionResponse] def get_session(session_id: str) -> ConcurrentFuture[types.GetSessionResponse]
``` ```
@ -474,7 +436,6 @@ print(f"Samplers: {len(response.sampler_ids)}")
#### `get_session_async` #### `get_session_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_session_async(session_id: str) -> types.GetSessionResponse async def get_session_async(session_id: str) -> types.GetSessionResponse
``` ```
@ -483,8 +444,6 @@ Async version of get_session.
#### `list_sessions` #### `list_sessions`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def list_sessions( def list_sessions(
limit: int = 20, limit: int = 20,
offset: int = 0) -> ConcurrentFuture[types.ListSessionsResponse] offset: int = 0) -> ConcurrentFuture[types.ListSessionsResponse]
@ -511,7 +470,6 @@ next_page = rest_client.list_sessions(limit=50, offset=50)
#### `list_sessions_async` #### `list_sessions_async`
```python ```python
@capture_exceptions(fatal=True)
async def list_sessions_async(limit: int = 20, async def list_sessions_async(limit: int = 20,
offset: int = 0) -> types.ListSessionsResponse offset: int = 0) -> types.ListSessionsResponse
``` ```
@ -521,7 +479,6 @@ Async version of list_sessions.
#### `get_sampler` #### `get_sampler`
```python ```python
@capture_exceptions(fatal=True)
def get_sampler(sampler_id: str) -> APIFuture[types.GetSamplerResponse] def get_sampler(sampler_id: str) -> APIFuture[types.GetSamplerResponse]
``` ```
@ -549,7 +506,6 @@ print(f"Base model: {response.base_model}")
#### `get_sampler_async` #### `get_sampler_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_sampler_async(sampler_id: str) -> types.GetSamplerResponse async def get_sampler_async(sampler_id: str) -> types.GetSamplerResponse
``` ```

View file

@ -1,5 +1,3 @@
# `tinker.lib.public_interfaces.sampling_client`
SamplingClient for Tinker API. SamplingClient for Tinker API.
## `SamplingClient` Objects ## `SamplingClient` Objects
@ -35,7 +33,6 @@ result = future.result()
#### `sample` #### `sample`
```python ```python
@capture_exceptions(fatal=True)
def sample( def sample(
prompt: types.ModelInput, prompt: types.ModelInput,
num_samples: int, num_samples: int,
@ -82,7 +79,6 @@ Async version of sample.
#### `compute_logprobs` #### `compute_logprobs`
```python ```python
@capture_exceptions(fatal=True)
def compute_logprobs( def compute_logprobs(
prompt: types.ModelInput) -> ConcurrentFuture[list[float | None]] prompt: types.ModelInput) -> ConcurrentFuture[list[float | None]]
``` ```

View file

@ -1,5 +1,3 @@
# `tinker.lib.public_interfaces.service_client`
ServiceClient for Tinker API. ServiceClient for Tinker API.
## `ServiceClient` Objects ## `ServiceClient` Objects
@ -36,8 +34,6 @@ rest_client = client.create_rest_client()
#### `get_server_capabilities` #### `get_server_capabilities`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_server_capabilities() -> types.GetServerCapabilitiesResponse def get_server_capabilities() -> types.GetServerCapabilitiesResponse
``` ```
@ -56,7 +52,6 @@ print(f"Max batch size: {capabilities.max_batch_size}")
#### `get_server_capabilities_async` #### `get_server_capabilities_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_server_capabilities_async( async def get_server_capabilities_async(
) -> types.GetServerCapabilitiesResponse ) -> types.GetServerCapabilitiesResponse
``` ```
@ -66,8 +61,6 @@ Async version of get_server_capabilities.
#### `create_lora_training_client` #### `create_lora_training_client`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def create_lora_training_client( def create_lora_training_client(
base_model: str, base_model: str,
rank: int = 32, rank: int = 32,
@ -106,7 +99,6 @@ training_client = service_client.create_lora_training_client(
#### `create_lora_training_client_async` #### `create_lora_training_client_async`
```python ```python
@capture_exceptions(fatal=True)
async def create_lora_training_client_async( async def create_lora_training_client_async(
base_model: str, base_model: str,
rank: int = 32, rank: int = 32,
@ -122,8 +114,6 @@ Async version of create_lora_training_client.
#### `create_training_client_from_state` #### `create_training_client_from_state`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def create_training_client_from_state( def create_training_client_from_state(
path: str, path: str,
user_metadata: dict[str, str] | None = None) -> TrainingClient user_metadata: dict[str, str] | None = None) -> TrainingClient
@ -150,7 +140,6 @@ training_client = service_client.create_training_client_from_state(
#### `create_training_client_from_state_async` #### `create_training_client_from_state_async`
```python ```python
@capture_exceptions(fatal=True)
async def create_training_client_from_state_async( async def create_training_client_from_state_async(
path: str, path: str,
user_metadata: dict[str, str] | None = None) -> TrainingClient user_metadata: dict[str, str] | None = None) -> TrainingClient
@ -161,7 +150,6 @@ Async version of create_training_client_from_state.
#### `create_sampling_client` #### `create_sampling_client`
```python ```python
@capture_exceptions(fatal=True)
def create_sampling_client( def create_sampling_client(
model_path: str | None = None, model_path: str | None = None,
base_model: str | None = None, base_model: str | None = None,
@ -197,7 +185,6 @@ sampling_client = service_client.create_sampling_client(
#### `create_sampling_client_async` #### `create_sampling_client_async`
```python ```python
@capture_exceptions(fatal=True)
async def create_sampling_client_async( async def create_sampling_client_async(
model_path: str | None = None, model_path: str | None = None,
base_model: str | None = None, base_model: str | None = None,
@ -209,7 +196,6 @@ Async version of create_sampling_client.
#### `create_rest_client` #### `create_rest_client`
```python ```python
@capture_exceptions(fatal=True)
def create_rest_client() -> RestClient def create_rest_client() -> RestClient
``` ```

View file

@ -1,5 +1,3 @@
# `tinker.lib.public_interfaces.training_client`
TrainingClient for Tinker API. TrainingClient for Tinker API.
## `TrainingClient` Objects ## `TrainingClient` Objects
@ -34,7 +32,6 @@ sampling_client = training_client.save_weights_and_get_sampling_client("my-model
#### `forward` #### `forward`
```python ```python
@capture_exceptions(fatal=True)
def forward( def forward(
data: List[types.Datum], data: List[types.Datum],
loss_fn: types.LossFnType, loss_fn: types.LossFnType,
@ -78,7 +75,6 @@ Async version of forward.
#### `forward_backward` #### `forward_backward`
```python ```python
@capture_exceptions(fatal=True)
def forward_backward( def forward_backward(
data: List[types.Datum], data: List[types.Datum],
loss_fn: types.LossFnType, loss_fn: types.LossFnType,
@ -130,8 +126,6 @@ Async version of forward_backward.
#### `forward_backward_custom` #### `forward_backward_custom`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def forward_backward_custom( def forward_backward_custom(
data: List[types.Datum], data: List[types.Datum],
loss_fn: CustomLossFnV1) -> APIFuture[types.ForwardBackwardOutput] loss_fn: CustomLossFnV1) -> APIFuture[types.ForwardBackwardOutput]
@ -166,7 +160,6 @@ print(f"Metrics: {result.metrics}")
#### `forward_backward_custom_async` #### `forward_backward_custom_async`
```python ```python
@capture_exceptions(fatal=True)
async def forward_backward_custom_async( async def forward_backward_custom_async(
data: List[types.Datum], data: List[types.Datum],
loss_fn: CustomLossFnV1) -> APIFuture[types.ForwardBackwardOutput] loss_fn: CustomLossFnV1) -> APIFuture[types.ForwardBackwardOutput]
@ -177,7 +170,6 @@ Async version of forward_backward_custom.
#### `optim_step` #### `optim_step`
```python ```python
@capture_exceptions(fatal=True)
def optim_step( def optim_step(
adam_params: types.AdamParams) -> APIFuture[types.OptimStepResponse] adam_params: types.AdamParams) -> APIFuture[types.OptimStepResponse]
``` ```
@ -220,7 +212,6 @@ Async version of optim_step.
#### `save_state` #### `save_state`
```python ```python
@capture_exceptions(fatal=True)
def save_state(name: str) -> APIFuture[types.SaveWeightsResponse] def save_state(name: str) -> APIFuture[types.SaveWeightsResponse]
``` ```
@ -251,7 +242,6 @@ Async version of save_state.
#### `load_state` #### `load_state`
```python ```python
@capture_exceptions(fatal=True)
def load_state(path: str) -> APIFuture[types.LoadWeightsResponse] def load_state(path: str) -> APIFuture[types.LoadWeightsResponse]
``` ```
@ -282,7 +272,6 @@ Async version of load_state.
#### `load_state_with_optimizer` #### `load_state_with_optimizer`
```python ```python
@capture_exceptions(fatal=True)
def load_state_with_optimizer( def load_state_with_optimizer(
path: str) -> APIFuture[types.LoadWeightsResponse] path: str) -> APIFuture[types.LoadWeightsResponse]
``` ```
@ -317,7 +306,6 @@ Async version of load_state_with_optimizer.
#### `save_weights_for_sampler` #### `save_weights_for_sampler`
```python ```python
@capture_exceptions(fatal=True)
def save_weights_for_sampler( def save_weights_for_sampler(
name: str) -> APIFuture[types.SaveWeightsForSamplerResponse] name: str) -> APIFuture[types.SaveWeightsForSamplerResponse]
``` ```
@ -355,8 +343,6 @@ Async version of save_weights_for_sampler.
#### `get_info` #### `get_info`
```python ```python
@sync_only
@capture_exceptions(fatal=True)
def get_info() -> types.GetInfoResponse def get_info() -> types.GetInfoResponse
``` ```
@ -376,7 +362,6 @@ print(f"LoRA rank: {info.model_data.lora_rank}")
#### `get_info_async` #### `get_info_async`
```python ```python
@capture_exceptions(fatal=True)
async def get_info_async() -> types.GetInfoResponse async def get_info_async() -> types.GetInfoResponse
``` ```
@ -385,8 +370,6 @@ Async version of get_info.
#### `get_tokenizer` #### `get_tokenizer`
```python ```python
@cache
@capture_exceptions(fatal=True)
def get_tokenizer() -> PreTrainedTokenizer def get_tokenizer() -> PreTrainedTokenizer
``` ```
@ -405,7 +388,6 @@ text = tokenizer.decode(tokens)
#### `create_sampling_client` #### `create_sampling_client`
```python ```python
@capture_exceptions(fatal=True)
def create_sampling_client( def create_sampling_client(
model_path: str, model_path: str,
retry_config: RetryConfig | None = None) -> SamplingClient retry_config: RetryConfig | None = None) -> SamplingClient
@ -431,7 +413,6 @@ sampling_client = training_client.create_sampling_client(
#### `create_sampling_client_async` #### `create_sampling_client_async`
```python ```python
@capture_exceptions(fatal=True)
async def create_sampling_client_async( async def create_sampling_client_async(
model_path: str, model_path: str,
retry_config: RetryConfig | None = None) -> SamplingClient retry_config: RetryConfig | None = None) -> SamplingClient
@ -442,7 +423,6 @@ Async version of create_sampling_client.
#### `save_weights_and_get_sampling_client` #### `save_weights_and_get_sampling_client`
```python ```python
@capture_exceptions(fatal=True)
def save_weights_and_get_sampling_client( def save_weights_and_get_sampling_client(
name: str | None = None, name: str | None = None,
retry_config: RetryConfig | None = None) -> SamplingClient retry_config: RetryConfig | None = None) -> SamplingClient
@ -471,7 +451,6 @@ result = sampling_client.sample(prompt, 1, params).result()
#### `save_weights_and_get_sampling_client_async` #### `save_weights_and_get_sampling_client_async`
```python ```python
@capture_exceptions(fatal=True)
async def save_weights_and_get_sampling_client_async( async def save_weights_and_get_sampling_client_async(
name: str | None = None, name: str | None = None,
retry_config: RetryConfig | None = None) -> SamplingClient retry_config: RetryConfig | None = None) -> SamplingClient

View file

@ -1,5 +1,3 @@
# `tinker.types.optim_step_request`
## `AdamParams` Objects ## `AdamParams` Objects
```python ```python
@ -22,8 +20,6 @@ Coefficient used for computing running averages of gradient square
Term added to the denominator to improve numerical stability Term added to the denominator to improve numerical stability
# `tinker.types.optim_step_response`
## `OptimStepResponse` Objects ## `OptimStepResponse` Objects
```python ```python
@ -34,8 +30,6 @@ class OptimStepResponse(BaseModel)
Optimization step metrics as key-value pairs Optimization step metrics as key-value pairs
# `tinker.types.model_input`
## `ModelInput` Objects ## `ModelInput` Objects
```python ```python
@ -49,7 +43,6 @@ Sequence of input chunks (formerly TokenSequence)
#### `from_ints` #### `from_ints`
```python ```python
@classmethod
def from_ints(cls, tokens: List[int]) -> "ModelInput" def from_ints(cls, tokens: List[int]) -> "ModelInput"
``` ```
@ -67,7 +60,6 @@ Throws exception if there are any non-token chunks
#### `length` #### `length`
```python ```python
@property
def length() -> int def length() -> int
``` ```
@ -76,7 +68,6 @@ Return the total context length used by this ModelInput.
#### `empty` #### `empty`
```python ```python
@classmethod
def empty(cls) -> "ModelInput" def empty(cls) -> "ModelInput"
``` ```
@ -98,8 +89,6 @@ def append_int(token: int) -> "ModelInput"
Add a new token, return a new ModelInput. Add a new token, return a new ModelInput.
# `tinker.types.weights_info_response`
## `WeightsInfoResponse` Objects ## `WeightsInfoResponse` Objects
```python ```python
@ -108,8 +97,6 @@ class WeightsInfoResponse(BaseModel)
Minimal information for loading public checkpoints. Minimal information for loading public checkpoints.
# `tinker.types.checkpoint`
## `Checkpoint` Objects ## `Checkpoint` Objects
```python ```python
@ -165,14 +152,11 @@ The checkpoint ID
#### `from_tinker_path` #### `from_tinker_path`
```python ```python
@classmethod
def from_tinker_path(cls, tinker_path: str) -> "ParsedCheckpointTinkerPath" def from_tinker_path(cls, tinker_path: str) -> "ParsedCheckpointTinkerPath"
``` ```
Parse a tinker path to an instance of ParsedCheckpointTinkerPath Parse a tinker path to an instance of ParsedCheckpointTinkerPath
# `tinker.types.checkpoint_archive_url_response`
## `CheckpointArchiveUrlResponse` Objects ## `CheckpointArchiveUrlResponse` Objects
```python ```python
@ -187,8 +171,6 @@ Signed URL to download the checkpoint archive
Unix timestamp when the signed URL expires, if available Unix timestamp when the signed URL expires, if available
# `tinker.types.sampled_sequence`
## `SampledSequence` Objects ## `SampledSequence` Objects
```python ```python
@ -207,8 +189,6 @@ List of generated token IDs
Log probabilities for each token (optional) Log probabilities for each token (optional)
# `tinker.types.try_again_response`
## `TryAgainResponse` Objects ## `TryAgainResponse` Objects
```python ```python
@ -219,8 +199,6 @@ class TryAgainResponse(BaseModel)
Request ID that is still pending Request ID that is still pending
# `tinker.types.load_weights_request`
## `LoadWeightsRequest` Objects ## `LoadWeightsRequest` Objects
```python ```python
@ -235,8 +213,6 @@ A tinker URI for model weights at a specific step
Whether to load optimizer state along with model weights Whether to load optimizer state along with model weights
# `tinker.types.telemetry_send_request`
## `TelemetrySendRequest` Objects ## `TelemetrySendRequest` Objects
```python ```python
@ -251,8 +227,6 @@ Host platform name
SDK version string SDK version string
# `tinker.types.image_asset_pointer_chunk`
## `ImageAssetPointerChunk` Objects ## `ImageAssetPointerChunk` Objects
```python ```python
@ -279,8 +253,6 @@ Number of tokens this image represents
Image width in pixels Image width in pixels
# `tinker.types.checkpoints_list_response`
## `CheckpointsListResponse` Objects ## `CheckpointsListResponse` Objects
```python ```python
@ -295,8 +267,6 @@ List of available model checkpoints for the model
Pagination cursor information (None for unpaginated responses) Pagination cursor information (None for unpaginated responses)
# `tinker.types.generic_event`
## `GenericEvent` Objects ## `GenericEvent` Objects
```python ```python
@ -319,8 +289,6 @@ Log severity level
Arbitrary structured JSON payload Arbitrary structured JSON payload
# `tinker.types.encoded_text_chunk`
## `EncodedTextChunk` Objects ## `EncodedTextChunk` Objects
```python ```python
@ -331,8 +299,6 @@ class EncodedTextChunk(StrictBase)
Array of token IDs Array of token IDs
# `tinker.types.forward_backward_input`
## `ForwardBackwardInput` Objects ## `ForwardBackwardInput` Objects
```python ```python
@ -351,8 +317,6 @@ Fully qualified function path for the loss function
Optional configuration parameters for the loss function (e.g., PPO clip thresholds, DPO beta) Optional configuration parameters for the loss function (e.g., PPO clip thresholds, DPO beta)
# `tinker.types.session_start_event`
## `SessionStartEvent` Objects ## `SessionStartEvent` Objects
```python ```python
@ -367,8 +331,6 @@ Telemetry event type
Log severity level Log severity level
# `tinker.types.training_runs_response`
## `TrainingRunsResponse` Objects ## `TrainingRunsResponse` Objects
```python ```python
@ -383,8 +345,6 @@ List of training runs
Pagination cursor information Pagination cursor information
# `tinker.types.save_weights_response`
## `SaveWeightsResponse` Objects ## `SaveWeightsResponse` Objects
```python ```python
@ -395,8 +355,6 @@ class SaveWeightsResponse(BaseModel)
A tinker URI for model weights at a specific step A tinker URI for model weights at a specific step
# `tinker.types.sample_request`
## `SampleRequest` Objects ## `SampleRequest` Objects
```python ```python
@ -444,8 +402,6 @@ Defaults to false.
If set to a positive integer, returns the top-k logprobs for each prompt token. If set to a positive integer, returns the top-k logprobs for each prompt token.
# `tinker.types.forward_backward_output`
## `ForwardBackwardOutput` Objects ## `ForwardBackwardOutput` Objects
```python ```python
@ -464,8 +420,6 @@ Dictionary mapping field names to tensor data
Training metrics as key-value pairs Training metrics as key-value pairs
# `tinker.types.sample_response`
## `SampleResponse` Objects ## `SampleResponse` Objects
```python ```python
@ -485,8 +439,6 @@ the top-k logprobs are computed for every token in the prompt. The
`topk_prompt_logprobs` response contains, for every token in the prompt, `topk_prompt_logprobs` response contains, for every token in the prompt,
a list of up to k (token_id, logprob) tuples. a list of up to k (token_id, logprob) tuples.
# `tinker.types.create_sampling_session_response`
## `CreateSamplingSessionResponse` Objects ## `CreateSamplingSessionResponse` Objects
```python ```python
@ -497,8 +449,6 @@ class CreateSamplingSessionResponse(BaseModel)
The generated sampling session ID The generated sampling session ID
# `tinker.types.cursor`
## `Cursor` Objects ## `Cursor` Objects
```python ```python
@ -517,8 +467,6 @@ The maximum number of items requested
The total number of items available The total number of items available
# `tinker.types.create_model_request`
## `CreateModelRequest` Objects ## `CreateModelRequest` Objects
```python ```python
@ -529,8 +477,6 @@ class CreateModelRequest(StrictBase)
Optional metadata about this model/training run, set by the end-user Optional metadata about this model/training run, set by the end-user
# `tinker.types.datum`
## `Datum` Objects ## `Datum` Objects
```python ```python
@ -544,15 +490,11 @@ Dictionary mapping field names to tensor data
#### `convert_tensors` #### `convert_tensors`
```python ```python
@model_validator(mode="before")
@classmethod
def convert_tensors(cls, data: Any) -> Any def convert_tensors(cls, data: Any) -> Any
``` ```
Convert torch.Tensor and numpy arrays to TensorData in loss_fn_inputs during construction. Convert torch.Tensor and numpy arrays to TensorData in loss_fn_inputs during construction.
# `tinker.types.training_run`
## `TrainingRun` Objects ## `TrainingRun` Objects
```python ```python
@ -599,8 +541,6 @@ The most recent sampler checkpoint, if available
Optional metadata about this training run, set by the end-user Optional metadata about this training run, set by the end-user
# `tinker.types.session_end_event`
## `SessionEndEvent` Objects ## `SessionEndEvent` Objects
```python ```python
@ -619,8 +559,6 @@ Telemetry event type
Log severity level Log severity level
# `tinker.types.telemetry_batch`
## `TelemetryBatch` Objects ## `TelemetryBatch` Objects
```python ```python
@ -635,8 +573,6 @@ Host platform name
SDK version string SDK version string
# `tinker.types.unhandled_exception_event`
## `UnhandledExceptionEvent` Objects ## `UnhandledExceptionEvent` Objects
```python ```python
@ -655,8 +591,6 @@ Log severity level
Optional Python traceback string Optional Python traceback string
# `tinker.types.image_chunk`
## `ImageChunk` Objects ## `ImageChunk` Objects
```python ```python
@ -693,8 +627,6 @@ match expected_tokens.
#### `validate_data` #### `validate_data`
```python ```python
@field_validator("data", mode="before")
@classmethod
def validate_data(cls, value: Union[bytes, str]) -> bytes def validate_data(cls, value: Union[bytes, str]) -> bytes
``` ```
@ -703,14 +635,11 @@ Deserialize base64 string to bytes if needed.
#### `serialize_data` #### `serialize_data`
```python ```python
@field_serializer("data")
def serialize_data(value: bytes) -> str def serialize_data(value: bytes) -> str
``` ```
Serialize bytes to base64 string for JSON. Serialize bytes to base64 string for JSON.
# `tinker.types.save_weights_request`
## `SaveWeightsRequest` Objects ## `SaveWeightsRequest` Objects
```python ```python
@ -721,8 +650,6 @@ class SaveWeightsRequest(StrictBase)
A file/directory name for the weights A file/directory name for the weights
# `tinker.types.lora_config`
## `LoraConfig` Objects ## `LoraConfig` Objects
```python ```python
@ -751,8 +678,6 @@ Whether to add loras to the MLP layers (including MoE layers)
Whether to add loras to the attention layers Whether to add loras to the attention layers
# `tinker.types.create_sampling_session_request`
## `CreateSamplingSessionRequest` Objects ## `CreateSamplingSessionRequest` Objects
```python ```python
@ -780,8 +705,6 @@ Optional tinker:// path to your model weights or LoRA weights.
If not provided, samples against the base model. If not provided, samples against the base model.
# `tinker.types.future_retrieve_request`
## `FutureRetrieveRequest` Objects ## `FutureRetrieveRequest` Objects
```python ```python
@ -792,8 +715,6 @@ class FutureRetrieveRequest(StrictBase)
The ID of the request to retrieve The ID of the request to retrieve
# `tinker.types.tensor_data`
## `TensorData` Objects ## `TensorData` Objects
```python ```python
@ -828,8 +749,6 @@ def to_torch() -> "torch.Tensor"
Convert TensorData to torch tensor. Convert TensorData to torch tensor.
# `tinker.types.save_weights_for_sampler_request`
## `SaveWeightsForSamplerRequest` Objects ## `SaveWeightsForSamplerRequest` Objects
```python ```python
@ -840,8 +759,6 @@ class SaveWeightsForSamplerRequest(StrictBase)
A file/directory name for the weights A file/directory name for the weights
# `tinker.types.sampling_params`
## `SamplingParams` Objects ## `SamplingParams` Objects
```python ```python
@ -872,8 +789,6 @@ Top-k sampling parameter (-1 for no limit)
Nucleus sampling probability Nucleus sampling probability
# `tinker.types.save_weights_for_sampler_response`
## `SaveWeightsForSamplerResponseInternal` Objects ## `SaveWeightsForSamplerResponseInternal` Objects
```python ```python
@ -898,8 +813,6 @@ class SaveWeightsForSamplerResponse(BaseModel)
A tinker URI for model weights for sampling at a specific step A tinker URI for model weights for sampling at a specific step
# `tinker.types.load_weights_response`
## `LoadWeightsResponse` Objects ## `LoadWeightsResponse` Objects
```python ```python

View file

@ -21,5 +21,7 @@ renderer:
code_lang: true code_lang: true
escape_html_in_docstring: false escape_html_in_docstring: false
insert_header_anchors: false insert_header_anchors: false
signature_code_block: true render_module_header: false
render_toc: false render_toc: false
signature_code_block: true
signature_with_decorators: false