API Documentation

Submit Batch Finetuning Jobs

POST/api/finetune-batch

The POST API endpoint /finetune-batch trains several models with one finetuning tool in a single request. The request body is the same as /submit-batch's, except the tool is named by model instead of type. Authentication, validation, the response and every error are the same as /submit-batch. Submit batches of finetuning tools here: /submit-batch may refuse them with a 400 whose code is use_finetune_endpoint.

Parameters:

batchName

(string, required)

Name for the batch, exactly as on /submit-batch.

model

(string, required)

The finetuning tool to run for every job in the batch, for example "chemprop-finetune". GET /tools marks these tools with "finetune": true.

settings

(array, required)

One settings object per model to train, exactly as on /submit-batch. Fetch the schema from GET /tools/{name}/schema.

settings[].parentModelId

(string, optional)

Train the next version of an existing model: that model's id (the "id" from GET /finetuned-models). Most finetuning tools accept it; one that does not refuses it as an unknown setting. The model must be one you can access and trained with the same tool, or the batch is refused with a 400.

jobNames, projectTag, ...

(optional)

Every other field /submit-batch accepts is accepted here with the same meaning.

Finetune-specific 400 responses:

Checked in this order, each answered as JSON { "error": "...", "code": "..." }. Any other 400 is exactly what /submit-batch would answer: plain text or JSON, so parse the body before reading it.

model_required

The body has no "model".

type_model_mismatch

"type" was also sent and differs from "model". Send only "model".

not_a_finetune_tool

"model" is not a finetuning tool. Submit it with POST /submit-batch instead.

HTTP Response Status Codes
Status codeDescription
200Batch successfully submitted
400Bad request
403Forbidden - organization or team budget exceeded
500Internal server error
1import requests
2
3api_key = "***************"
4headers = {'x-api-key': api_key}
5base_url = "https://app.tamarind.bio/api/"
6
7# Same body as /submit-batch, with the tool in "model" instead of "type".
8# One settings object per model to train.
9params = {
10    "batchName": "my-property-models",
11    "model": "chemprop-finetune",
12    "settings": [
13        {
14            "task": "regression",
15            "csvFile": "solubility.csv",  # uploaded with PUT /upload/{filename}
16            "smilesColumn": "smiles",
17            "propertyColumn": "logS"
18        },
19        {
20            "task": "regression",
21            "csvFile": "permeability.csv",
22            "smilesColumn": "smiles",
23            "propertyColumn": "logPapp"
24        }
25    ],
26    "jobNames": ["solubility-model", "permeability-model"]
27}
28response = requests.post(base_url + "finetune-batch", headers=headers, json=params)
29if response.ok:
30    print(response.text)  # "my-property-models batch submitted to queue."
31else:
32    # A 400 is plain text OR JSON. The finetune refusals are JSON with a "code".
33    try:
34        print(response.json())
35    except ValueError:
36        print(response.text)
Response Format
myBatchName batch submitted to queue.