Create an AutoScientist run
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
Base model id from GET /autoscientist/models. By default, AutoScientist selects a suitable model. The resolved model is returned in the response model field.
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).
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).
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.
Create an AutoScientist run
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){
"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": {}
}Returns Examples
{
"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": {}
}