# Autoscientist ## Create an AutoScientist run `autoscientist.create(AutoscientistCreateParams**kwargs) -> AutoscientistRun` **post** `/api/v1/autoscientist` Starts an iterative AutoScientist loop on a dataset you own. The loop runs up to max_iterations training cycles, stopping early when target_win_rate is achieved. Omitted parameters are resolved to platform defaults for the selected model and returned in the response. Poll GET /autoscientist/{experiment_id} for status, then GET /autoscientist/{experiment_id}/download once it succeeds. ### Parameters - `dataset_id: str` The dataset to train on. Must be a dataset you own that has finished processing. - `model: Optional[str]` Base model id from GET /autoscientist/models. By default, AutoScientist selects a suitable model. The resolved model is returned in the response `model` field. - `data_format: Optional[Literal["chat", "instruction"]]` How training rows are interpreted. Defaults to `chat` when omitted. - `"chat"` - `"instruction"` - `column_mapping: Optional[ColumnMapping]` Which dataset columns feed training. When omitted, AutoScientist infers the mapping from the dataset. Required columns depend on the data format. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `hyperparams: Optional[Hyperparams]` Hyperparameter overrides. Not advised. AutoScientist derives these values from the resolved model and the effective dataset size; any field supplied here replaces the derived value for that field. Call POST /autoscientist/recommend-hyperparams to inspect the derived values without launching a run. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `augmentation_domain_rows: Optional[float]` Number of synthetic domain-targeted rows to generate and append to the dataset before training. These are additional to your own rows, not a resampling of them, and count toward the effective training size used to derive hyperparameters. Defaults to 0 (no augmentation). - `augmentation_general_rows: Optional[float]` Number of synthetic general-diversity rows to generate and append to the dataset before training. These are additional to your own rows, not a resampling of them, and count toward the effective training size used to derive hyperparameters. Defaults to 0 (no augmentation). - `idempotency_key: Optional[str]` Client-generated key for safe retries. Scoped to `dataset_id`: while a run started with this key is still in progress, repeating the request returns that run instead of starting a second one. Once the run reaches a terminal state (succeeded, failed or cancelled) the key no longer matches and the same request starts a new run. - `voucher: Optional[str]` Optional discount voucher code. - `max_iterations: Optional[float]` Maximum number of iterations to run. Defaults to the resolved model configuration (currently 3). The resolved value is returned in the response `max_iterations` field. - `target_win_rate: Optional[float]` Target win rate for the AutoScientist loop (between 0 exclusive and 1 inclusive). Defaults to 0.7 for small models and 0.8 for larger models. The resolved value is returned in the response `target_win_rate` field. ### Returns - `class AutoscientistRun: …` - `id: str` AutoScientist run id. - `dataset_id: Optional[object]` Public id of the dataset the run trained on. - `model: Optional[object]` Resolved base model id used, including an automatically selected model. - `status: Literal["pending", "running", "succeeded", 2 more]` - `"pending"` - `"running"` - `"succeeded"` - `"failed"` - `"cancelled"` - `created_at: datetime` - `completed_at: Optional[object]` - `iterations_completed: float` Number of completed iterations. - `max_iterations: float` Resolved maximum number of iterations, including the model-specific default. - `target_win_rate: float` Resolved target win rate for the AutoScientist loop, including the model-specific default. - `best_win_rate: Optional[object]` Best win rate achieved so far. - `best_hyperparams: Optional[BestHyperparams]` Hyperparameters that produced the best iteration so far, and the ones the downloadable artifact was trained with. Null until an iteration completes. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `column_mapping: Optional[ColumnMapping]` Column mapping the run trained with, echoing what was sent on create. Null when the mapping was left to the platform to infer. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `download_available: bool` True when the best trained artifact can be downloaded. - `error: Optional[object]` Why the run failed. Null unless `status` is `failed`. ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) autoscientist_run = client.autoscientist.create( dataset_id="dataset_id", ) print(autoscientist_run.id) ``` #### Response ```json { "id": "id", "dataset_id": {}, "model": {}, "status": "pending", "created_at": "2019-12-27T18:11:19.117Z", "completed_at": {}, "iterations_completed": 0, "max_iterations": 0, "target_win_rate": 0, "best_win_rate": {}, "best_hyperparams": { "n_epochs": 1, "batch_size": "max", "learning_rate": 0.00005, "lora_r": 8, "lora_alpha": 0, "lora_dropout": 0, "lora_trainable_modules": "q_proj,v_proj", "lr_scheduler_type": "linear", "min_lr_ratio": 0.1, "scheduler_num_cycles": 0.5, "warmup_ratio": 0.03, "max_grad_norm": 2, "weight_decay": 0, "train_on_inputs": false, "training_type": "lora" }, "column_mapping": { "prompt": "prompt", "completion": "completion", "reasoning_trace": "reasoning_trace" }, "download_available": true, "error": {} } ``` ## Recommend hyperparameters `autoscientist.recommend_hyperparams(AutoscientistRecommendHyperparamsParams**kwargs) -> AutoscientistRecommendHyperparamsResponse` **post** `/api/v1/autoscientist/recommend-hyperparams` Returns the hyperparameters AutoScientist derives for a model and the dataset's effective training size (rows plus planned augmentation). Nothing is launched. Omit `model` to size against the model POST /autoscientist would select for this dataset; the resolved id is returned with the values. POST /autoscientist applies the same values when `hyperparams` is omitted. ### Parameters - `dataset_id: str` The dataset the hyperparameters are sized for. Must be a dataset you own that has finished processing. - `model: Optional[str]` Base model id from GET /autoscientist/models to tune for. Omit to size the recommendation against the model POST /autoscientist selects for this dataset; the resolved id is returned in the response `model` field. That pick reads the columns already selected for the dataset, so a create request supplying `column_mapping.reasoning_trace` can resolve a different model. Pass the returned `model` back on create to pin it. - `augmentation_domain_rows: Optional[float]` Number of synthetic domain-targeted rows you plan to generate. These are additional to your own rows and count toward the effective training size, so the recommendation matches what you will launch. Defaults to 0 (no augmentation). - `augmentation_general_rows: Optional[float]` Number of synthetic general-diversity rows you plan to generate. These are additional to your own rows and count toward the effective training size. Defaults to 0 (no augmentation). ### Returns - `class AutoscientistRecommendHyperparamsResponse: …` - `model: str` Resolved base model id the recommendation is sized for: the value you sent, or the automatically selected model when `model` was omitted. Pass it back as `model` on POST /autoscientist to launch against the same model. - `hyperparams: Hyperparams` Hyperparameters derived for the resolved model and effective dataset size. POST /autoscientist applies the same values when `hyperparams` is omitted. Overriding is not advised. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) response = client.autoscientist.recommend_hyperparams( dataset_id="dataset_id", ) print(response.model) ``` #### Response ```json { "model": "model", "hyperparams": { "n_epochs": 1, "batch_size": "max", "learning_rate": 0.00005, "lora_r": 8, "lora_alpha": 0, "lora_dropout": 0, "lora_trainable_modules": "q_proj,v_proj", "lr_scheduler_type": "linear", "min_lr_ratio": 0.1, "scheduler_num_cycles": 0.5, "warmup_ratio": 0.03, "max_grad_norm": 2, "weight_decay": 0, "train_on_inputs": false, "training_type": "lora" } } ``` ## Retrieve an AutoScientist run `autoscientist.get(strexperiment_id) -> AutoscientistRun` **get** `/api/v1/autoscientist/{experiment_id}` Retrieve an AutoScientist run ### Parameters - `experiment_id: str` ### Returns - `class AutoscientistRun: …` - `id: str` AutoScientist run id. - `dataset_id: Optional[object]` Public id of the dataset the run trained on. - `model: Optional[object]` Resolved base model id used, including an automatically selected model. - `status: Literal["pending", "running", "succeeded", 2 more]` - `"pending"` - `"running"` - `"succeeded"` - `"failed"` - `"cancelled"` - `created_at: datetime` - `completed_at: Optional[object]` - `iterations_completed: float` Number of completed iterations. - `max_iterations: float` Resolved maximum number of iterations, including the model-specific default. - `target_win_rate: float` Resolved target win rate for the AutoScientist loop, including the model-specific default. - `best_win_rate: Optional[object]` Best win rate achieved so far. - `best_hyperparams: Optional[BestHyperparams]` Hyperparameters that produced the best iteration so far, and the ones the downloadable artifact was trained with. Null until an iteration completes. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `column_mapping: Optional[ColumnMapping]` Column mapping the run trained with, echoing what was sent on create. Null when the mapping was left to the platform to infer. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `download_available: bool` True when the best trained artifact can be downloaded. - `error: Optional[object]` Why the run failed. Null unless `status` is `failed`. ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) autoscientist_run = client.autoscientist.get( "experiment_id", ) print(autoscientist_run.id) ``` #### Response ```json { "id": "id", "dataset_id": {}, "model": {}, "status": "pending", "created_at": "2019-12-27T18:11:19.117Z", "completed_at": {}, "iterations_completed": 0, "max_iterations": 0, "target_win_rate": 0, "best_win_rate": {}, "best_hyperparams": { "n_epochs": 1, "batch_size": "max", "learning_rate": 0.00005, "lora_r": 8, "lora_alpha": 0, "lora_dropout": 0, "lora_trainable_modules": "q_proj,v_proj", "lr_scheduler_type": "linear", "min_lr_ratio": 0.1, "scheduler_num_cycles": 0.5, "warmup_ratio": 0.03, "max_grad_norm": 2, "weight_decay": 0, "train_on_inputs": false, "training_type": "lora" }, "column_mapping": { "prompt": "prompt", "completion": "completion", "reasoning_trace": "reasoning_trace" }, "download_available": true, "error": {} } ``` ## List AutoScientist runs `autoscientist.list(AutoscientistListParams**kwargs) -> SyncCursorRuns[AutoscientistRun]` **get** `/api/v1/autoscientist` List AutoScientist runs ### Parameters - `limit: Optional[float]` Page size (max 100, default 20). - `cursor: Optional[str]` next_cursor from a previous page. - `dataset_id: Optional[str]` Only runs for this dataset. ### Returns - `class AutoscientistRun: …` - `id: str` AutoScientist run id. - `dataset_id: Optional[object]` Public id of the dataset the run trained on. - `model: Optional[object]` Resolved base model id used, including an automatically selected model. - `status: Literal["pending", "running", "succeeded", 2 more]` - `"pending"` - `"running"` - `"succeeded"` - `"failed"` - `"cancelled"` - `created_at: datetime` - `completed_at: Optional[object]` - `iterations_completed: float` Number of completed iterations. - `max_iterations: float` Resolved maximum number of iterations, including the model-specific default. - `target_win_rate: float` Resolved target win rate for the AutoScientist loop, including the model-specific default. - `best_win_rate: Optional[object]` Best win rate achieved so far. - `best_hyperparams: Optional[BestHyperparams]` Hyperparameters that produced the best iteration so far, and the ones the downloadable artifact was trained with. Null until an iteration completes. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `column_mapping: Optional[ColumnMapping]` Column mapping the run trained with, echoing what was sent on create. Null when the mapping was left to the platform to infer. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `download_available: bool` True when the best trained artifact can be downloaded. - `error: Optional[object]` Why the run failed. Null unless `status` is `failed`. ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) page = client.autoscientist.list() page = page.runs[0] print(page.id) ``` #### Response ```json { "runs": [ { "id": "id", "dataset_id": {}, "model": {}, "status": "pending", "created_at": "2019-12-27T18:11:19.117Z", "completed_at": {}, "iterations_completed": 0, "max_iterations": 0, "target_win_rate": 0, "best_win_rate": {}, "best_hyperparams": { "n_epochs": 1, "batch_size": "max", "learning_rate": 0.00005, "lora_r": 8, "lora_alpha": 0, "lora_dropout": 0, "lora_trainable_modules": "q_proj,v_proj", "lr_scheduler_type": "linear", "min_lr_ratio": 0.1, "scheduler_num_cycles": 0.5, "warmup_ratio": 0.03, "max_grad_norm": 2, "weight_decay": 0, "train_on_inputs": false, "training_type": "lora" }, "column_mapping": { "prompt": "prompt", "completion": "completion", "reasoning_trace": "reasoning_trace" }, "download_available": true, "error": {} } ], "next_cursor": "next_cursor" } ``` ## Cancel an AutoScientist run `autoscientist.cancel(strexperiment_id) -> AutoscientistRun` **post** `/api/v1/autoscientist/{experiment_id}/cancel` Cancel an AutoScientist run ### Parameters - `experiment_id: str` ### Returns - `class AutoscientistRun: …` - `id: str` AutoScientist run id. - `dataset_id: Optional[object]` Public id of the dataset the run trained on. - `model: Optional[object]` Resolved base model id used, including an automatically selected model. - `status: Literal["pending", "running", "succeeded", 2 more]` - `"pending"` - `"running"` - `"succeeded"` - `"failed"` - `"cancelled"` - `created_at: datetime` - `completed_at: Optional[object]` - `iterations_completed: float` Number of completed iterations. - `max_iterations: float` Resolved maximum number of iterations, including the model-specific default. - `target_win_rate: float` Resolved target win rate for the AutoScientist loop, including the model-specific default. - `best_win_rate: Optional[object]` Best win rate achieved so far. - `best_hyperparams: Optional[BestHyperparams]` Hyperparameters that produced the best iteration so far, and the ones the downloadable artifact was trained with. Null until an iteration completes. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `column_mapping: Optional[ColumnMapping]` Column mapping the run trained with, echoing what was sent on create. Null when the mapping was left to the platform to infer. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `download_available: bool` True when the best trained artifact can be downloaded. - `error: Optional[object]` Why the run failed. Null unless `status` is `failed`. ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) autoscientist_run = client.autoscientist.cancel( "experiment_id", ) print(autoscientist_run.id) ``` #### Response ```json { "id": "id", "dataset_id": {}, "model": {}, "status": "pending", "created_at": "2019-12-27T18:11:19.117Z", "completed_at": {}, "iterations_completed": 0, "max_iterations": 0, "target_win_rate": 0, "best_win_rate": {}, "best_hyperparams": { "n_epochs": 1, "batch_size": "max", "learning_rate": 0.00005, "lora_r": 8, "lora_alpha": 0, "lora_dropout": 0, "lora_trainable_modules": "q_proj,v_proj", "lr_scheduler_type": "linear", "min_lr_ratio": 0.1, "scheduler_num_cycles": 0.5, "warmup_ratio": 0.03, "max_grad_norm": 2, "weight_decay": 0, "train_on_inputs": false, "training_type": "lora" }, "column_mapping": { "prompt": "prompt", "completion": "completion", "reasoning_trace": "reasoning_trace" }, "download_available": true, "error": {} } ``` ## Download the best trained model artifact `autoscientist.download(strexperiment_id) -> BinaryResponseContent` **get** `/api/v1/autoscientist/{experiment_id}/download` Download the best trained model artifact ### Parameters - `experiment_id: str` ### Returns - `BinaryResponseContent` ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) response = client.autoscientist.download( "experiment_id", ) print(response) content = response.read() print(content) ``` ## List available base models for training `autoscientist.list_models() -> AutoscientistListModelsResponse` **get** `/api/v1/autoscientist/models` Returns the set of base models that can be used as the `model` field when creating an AutoScientist run. ### Returns - `class AutoscientistListModelsResponse: …` - `models: List[Model]` - `id: str` Identifier to pass as `model` when creating a job. - `display_name: str` Human-readable model name. - `model_size: Optional[object]` Parameter count label (e.g. "8B", "70B"). - `context_length: Optional[object]` Maximum context window in tokens. - `methods: List[str]` Training methods supported (e.g. ["sft", "dpo"]). - `training_types: List[str]` Training types supported (e.g. ["lora", "full"]). ### Example ```python import os from adaption import Adaption client = Adaption( api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted ) response = client.autoscientist.list_models() print(response.models) ``` #### Response ```json { "models": [ { "id": "id", "display_name": "display_name", "model_size": {}, "context_length": {}, "methods": [ "string" ], "training_types": [ "string" ] } ] } ``` ## Domain Types ### Autoscientist Run - `class AutoscientistRun: …` - `id: str` AutoScientist run id. - `dataset_id: Optional[object]` Public id of the dataset the run trained on. - `model: Optional[object]` Resolved base model id used, including an automatically selected model. - `status: Literal["pending", "running", "succeeded", 2 more]` - `"pending"` - `"running"` - `"succeeded"` - `"failed"` - `"cancelled"` - `created_at: datetime` - `completed_at: Optional[object]` - `iterations_completed: float` Number of completed iterations. - `max_iterations: float` Resolved maximum number of iterations, including the model-specific default. - `target_win_rate: float` Resolved target win rate for the AutoScientist loop, including the model-specific default. - `best_win_rate: Optional[object]` Best win rate achieved so far. - `best_hyperparams: Optional[BestHyperparams]` Hyperparameters that produced the best iteration so far, and the ones the downloadable artifact was trained with. Null until an iteration completes. - `n_epochs: Optional[float]` - `batch_size: Optional[Union[Literal["max"], int, null]]` Either the literal 'max' or an integer of 1 or more. No fixed upper bound: the ceiling depends on the model and hardware, and a larger value is rejected at launch. Defaults to 'max'. - `Literal["max"]` - `"max"` - `int` - `learning_rate: Optional[float]` - `lora_r: Optional[float]` - `lora_alpha: Optional[float]` Must be 1× or 2× lora_r. Only checked when you supply lora_r in the same request; otherwise it is validated against the platform default. - `lora_dropout: Optional[float]` - `lora_trainable_modules: Optional[str]` 'all-linear' or comma-separated module list (e.g. 'q_proj,v_proj'). - `lr_scheduler_type: Optional[Literal["linear", "cosine", "constant"]]` - `"linear"` - `"cosine"` - `"constant"` - `min_lr_ratio: Optional[float]` - `scheduler_num_cycles: Optional[float]` Number of cosine decay cycles across training. Defaults to 0.5, a single half-cycle decay from the peak learning rate down to the floor. - `warmup_ratio: Optional[float]` - `max_grad_norm: Optional[float]` - `weight_decay: Optional[float]` - `train_on_inputs: Optional[bool]` Whether training loss is computed over the prompt tokens as well as the completion. `true` trains on the full sequence, `false` trains only on the completion. Omit to let the platform decide per example, which is the default. - `training_type: Optional[Literal["lora", "full"]]` Training strategy override. AutoScientist optimizes this by default; set it only when strictly necessary. - `"lora"` - `"full"` - `column_mapping: Optional[ColumnMapping]` Column mapping the run trained with, echoing what was sent on create. Null when the mapping was left to the platform to infer. - `prompt: Optional[str]` Source column holding the prompt/instruction text. - `completion: Optional[str]` Source column holding the target completion/response. Used for supervised (sft) training. - `reasoning_trace: Optional[str]` Optional source column holding a reasoning trace to train on. - `download_available: bool` True when the best trained artifact can be downloaded. - `error: Optional[object]` Why the run failed. Null unless `status` is `failed`.