API Reference Tinkex v#0.2.2

View Source

Modules

Documentation for Tinkex.

High-level HTTP API client for Tinkex.

Response compression handling for Tinkex API.

Future/promise retrieval endpoints.

HTTP header building and management for Tinkex API requests.

Request helpers for raw and streaming response access.

Model metadata and lifecycle endpoints.

Request preparation and body encoding for Tinkex API.

Wrapper around HTTP responses with metadata and parsing helpers.

HTTP response handling and error parsing for Tinkex API.

Low-level REST API endpoints for session and checkpoint management.

Retry logic with exponential backoff for Tinkex API requests.

Retry configuration with Python SDK parity.

Sampling API endpoints.

Service and model creation endpoints.

Session management endpoints.

Streaming response wrapper for SSE/event-stream endpoints.

Telemetry reporting endpoints.

Training API endpoints.

URL building and query parameter management for Tinkex API requests.

Weight management endpoints.

OTP application for the Tinkex SDK.

Byte size estimation for model inputs and datums.

Byte-budget semaphore for rate limiting by payload size.

Command-line interface entrypoint for the Tinkex escript.

Checkpoint management commands: save, list, info, publish, unpublish, delete, download.

Training run management commands: list and info.

Sampling/text generation command.

Version command to display version information.

Output formatting utilities for the CLI (JSON, table, size formatting, datetime).

Pagination logic for listing checkpoints and training runs.

Argument parsing helpers for the CLI.

Download and extract checkpoint archives with streaming support.

Client configuration for the Tinkex SDK.

Centralized environment variable access for Tinkex.

Error type for Tinkex operations.

Asynchronous wrapper around Tinkex.Files.Reader.

Synchronous helpers for reading file inputs and extracting metadata.

Normalize user-supplied file inputs into multipart-ready tuples.

Type helpers and guards for file upload inputs.

Client-side future abstraction responsible for polling server-side futures.

Helpers for combining chunked forward/backward results returned by the API.

Behaviour for HTTP client implementations.

Lightweight metrics aggregation for Tinkex telemetry events.

Metric reduction for chunked forward/backward results.

Build multipart/form-data request bodies (Finch does not encode multipart for us).

Flatten maps into multipart form fields using bracket notation.

Sentinel values for distinguishing omitted fields from explicit nil.

Centralized pool key generation and URL normalization.

Shared logging utilities for queue state changes.

Behaviour for modules that want to react to queue-state transitions.

Shared backoff state per {base_url, api_key} combination.

GenServer that performs recovery attempts for corrupted training runs.

Polls training runs for corruption flags and dispatches recovery work.

Configuration for opt-in training run recovery.

Behaviour for implementing regularizers.

Manages regularizer execution with process-based parallelism.

Computes gradient norms for regularizers using Nx automatic differentiation.

Orchestrates regularizer composition and computes structured loss output.

Telemetry helpers for regularizer events.

Consistency regularizer adapter using NxPenalties constraints.

Elastic Net adapter combining L1 and L2 via NxPenalties primitives.

Entropy regularizer adapter using NxPenalties.

Gradient penalty adapter built on NxPenalties primitives.

KL divergence adapter against a reference distribution using NxPenalties.

Adapter for L1 sparsity using NxPenalties primitives.

Adapter for L2/Tikhonov regularization using NxPenalties primitives.

Orthogonality regularizer adapter using NxPenalties constraints.

REST client for Tinker API operations.

User-facing retry configuration for sampling operations.

Blocking semaphore wrapper used to cap concurrent sampling retry executions.

Sampling client that performs lock-free reads via ETS.

Layered dispatch rate limiting for sampling requests.

Registry that tracks SamplingClient processes and cleans up ETS entries on exit.

Entry point for Tinkex operations.

Manages Tinkex sessions and heartbeats across multiple configs.

Minimal SSE decoder that can be fed incremental chunks.

Representation of a server-sent event.

Convenience helpers for wiring Tinkex telemetry into simple console logging or lightweight dashboards.

Client-side telemetry reporter that batches events and ships them to the Tinker backend via /api/v1/telemetry.

Retry and backoff calculation logic for telemetry reporter.

Event building for different telemetry event types.

Exception classification and cause chain traversal.

Queue operations for telemetry events.

Event serialization and sanitization for telemetry.

Tokenization entrypoint for the Tinkex SDK.

Custom loss training helpers.

GenServer that coordinates training operations for a single model.

Data chunking, numbering, and tensor operations for TrainingClient.

Queue state observation and logging for TrainingClient.

Request building and sending operations for TrainingClient.

Future polling and result awaiting for TrainingClient.

Tokenizer integration and operations for TrainingClient.

Lightweight serialization helpers for request payloads.

Adam optimizer parameters.

Checkpoint metadata.

Response containing a download URL for a checkpoint archive.

Response from list_checkpoints or list_user_checkpoints API.

Request to create a new model.

Response from create model request.

Request to create a new sampling session.

Response from create sampling session request.

Request to create a new training session.

Response from create session request.

Pagination cursor for paged responses.

Structured output from custom loss computation with regularizers.

Training example containing model input and loss function inputs.

Encoded text chunk containing token IDs.

Input for forward-backward pass.

Output from forward-backward pass.

Request for forward-backward pass.

Request for forward-only pass (inference without backward).

Response indicating a future has completed successfully.

Response indicating a future has failed.

Response indicating a future is still pending.

Request to retrieve the result of a future/async operation.

Union type for future retrieve responses.

Request payload for retrieving model metadata.

Response payload containing active model metadata.

Response from the get_sampler API call.

Supported model metadata returned by the service capabilities endpoint.

Response from get_session API.

Health check response.

Reference to a pre-uploaded image asset.

Image chunk with base64 encoded data.

Response from list_sessions API.

Request to load model weights from a checkpoint.

Response payload for load_weights.

LoRA configuration for model fine-tuning.

Loss function type.

Model metadata including architecture, display name, and tokenizer id.

Model input containing chunks of encoded text and/or images.

Request for optimizer step.

Response from optimizer step request.

Parsed representation of a checkpoint tinker path.

Queue state parser used by TryAgain responses.

Output metrics from a single regularizer computation.

Specification for a single regularizer in the composition pipeline.

Request error category.

Response indicating a request has failed.

Request for sampling/text generation.

Response from sampling/text generation request.

A single sampled sequence from text generation.

Parameters for text generation/sampling.

Request to save model weights for use in sampling.

Response payload for save_weights_for_sampler.

Request to save model weights as a checkpoint.

Response payload for save_weights.

Request to send a heartbeat for a session.

Response to a session heartbeat request.

Stop reason for sampling completion.

Metadata for a single supported model from the server capabilities response.

Event type enumeration for telemetry events.

Generic telemetry event structure.

Session end telemetry event.

Session start telemetry event.

Severity level enumeration for telemetry events.

Batch of telemetry events for transmission.

Union type for telemetry events.

Request structure for sending telemetry to the backend.

Unhandled exception telemetry event.

Response to a telemetry send request.

Numerical tensor data for training.

Tensor data type.

Training run metadata with last checkpoint details.

Paginated training run response.

Response indicating queue backpressure - the client should retry polling.

Type aliases for Python SDK parity.

Request payload to unload model weights and end the session.

Response confirming a model unload request.

Minimal information for loading public checkpoints.