Gridline
v0.1.7Post-train open models (fine-tuning, RL, distillation), evaluate and batch them on Gridline.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_models List models
List the base models you can batch or fine-tune on, and your own ft: models. Free: no charge.
get_credit_balance Credit balance
Your credit balance and low-credit threshold (Gridline's usage summary), plus your most recent charges. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Page size, 1 to 100. |
upload_file Upload a file
Upload a local JSONL file to the Files API. purpose "fine-tune" for training/validation data (OpenAI chat format; DPO preference rows for DPO), "batch" for a batch input file (one request per line). At most 200 MB. Returns the file object; use its id in create_fine_tune, create_batch or an eval run. Free: no charge. Stored files count toward your storage limits.
| Parameter | Type | Description |
|---|---|---|
path * | string | Local path of the JSONL file to upload. |
purpose * | string | "fine-tune" or "batch". |
create_fine_tune Create a fine-tuning job
Start a fine-tuning job (OpenAI's /fine_tuning/jobs shape) that trains a LoRA or QLoRA adapter on an open base model and names the result with an ft: id, or quote it with dry_run: true. method: "lora" or "qlora" as a string, or OpenAI's {"type": "supervised", "supervised": {"adapter": "lora", "hyperparameters": {...}}} or {"type": "dpo", "dpo": {"hyperparameters": {"beta": ...}}}. Hyperparameters (n_epochs, batch_size, learning_rate_multiplier, lora_rank, lora_alpha, max_seq_length) go in hyperparameters or inside method, once. Costs credit: a fine-tune is charged per 1M trained tokens (traini…
| Parameter | Type | Description |
|---|---|---|
model * | string | Base model id, e.g. qwen3.5-9b (see list_models). |
training_file * | string | File id of the training data (purpose fine-tune). |
confirm_spend | boolean | Must be true for this call to run: you have read the quote or price and accept the charge. |
dry_run | boolean | true: return the quote and the credit check only; nothing is created or charged. |
hyperparameters | object | Training settings. |
metadata | object | |
method | "lora", "qlora", or an OpenAI method object (supervised or dpo). | |
seed | integer | |
suffix | string | A short label in the ft: model name. |
validation_file | string | Optional validation file id. |
list_fine_tunes List fine-tuning jobs
List your fine-tuning jobs, newest first. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
after | string | Cursor: the last id of the previous page. |
limit | integer | Page size, 1 to 100. |
get_fine_tune Get a fine-tuning job
A fine-tuning job's status, its quote and, once it succeeds, its ft: model. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Fine-tuning job id (ftjob-...). |
list_fine_tune_events Fine-tuning job events
A fine-tuning job's events: progress, training and validation loss, warnings and errors. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Fine-tuning job id. |
after | string | Cursor: the last id of the previous page. |
limit | integer | Page size, 1 to 100. |
cancel_fine_tune Cancel a fine-tuning job
Cancel a fine-tuning job. It stops the job; read the job afterwards (get_fine_tune) for its final state and charge. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Fine-tuning job id. |
create_batch Create a batch
Run a batch (OpenAI's /batches shape) over an uploaded batch file on a base model or your ft: model. endpoint: "/v1/chat/completions" (default) or "/v1/embeddings". completion_window: "24h" (default) or Gridline's looser "72h". Costs credit: a batch is charged per 1M input and output tokens at the model's published batch price, and at least the model's per-batch minimum (https://gridlinegpu.com/pricing). A batch whose upper bound your credit cannot cover is refused before it runs. Requires confirm_spend: true.
| Parameter | Type | Description |
|---|---|---|
input_file_id * | string | File id of the batch input (purpose batch). |
completion_window | string | Default "24h". |
confirm_spend | boolean | Must be true for this call to run: you have read the quote or price and accept the charge. |
endpoint | string | Default "/v1/chat/completions". |
metadata | object |
get_batch Get a batch
A batch's status, request counts, cost and its output/error file ids. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Batch id (batch_...). |
cancel_batch Cancel a batch
Cancel a batch. A cancelled batch still delivers, and charges for, the requests that completed; the rest are not run. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Batch id. |
download_results Download batch results
Save a batch's output (or error) file to a local path. Give batch_id (which: "output" or "error") or a file_id. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Local path to write the JSONL to. |
batch_id | string | Batch id. |
file_id | string | A file id to download instead of a batch's. |
which | string | Default "output". |
create_eval Create an eval
Define an eval (OpenAI's Evals API): data_source_config (the item schema) and testing_criteria (graders: string_check, text_similarity, score_model). Defining it is free; runs cost credit (see create_eval_run).
| Parameter | Type | Description |
|---|---|---|
data_source_config * | object | OpenAI data_source_config. |
testing_criteria * | array | Graders, OpenAI's shape. |
metadata | object | |
name | string |
create_eval_run Run an eval
Run an eval over a data source: a file of items, or completions sampled from a model (a base model or your ft: model, to compare them). Costs credit unless dry_run is true: an eval run is billed as ordinary batches at published batch prices, each at least its model's per-batch minimum (https://gridlinegpu.com/pricing). A run that only uses string_check and text_similarity on a file's own answers creates no batch and costs nothing. Send dry_run: true first to get the quote. Requires confirm_spend: true unless dry_run is true.
| Parameter | Type | Description |
|---|---|---|
data_source * | object | OpenAI eval run data_source. |
eval_id * | string | Eval id (eval_...). |
confirm_spend | boolean | Must be true for this call to run: you have read the quote or price and accept the charge. |
dry_run | boolean | true: return the quote only; nothing runs. |
metadata | object | |
name | string |
get_eval_run Get an eval run
An eval run's status, per-grader results, cost and its results file. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
eval_id * | string | Eval id. |
run_id * | string | Run id (evalrun_...). |
list_output_items Eval run output items
An eval run's graded items: each sample and every grader's result. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
eval_id * | string | Eval id. |
run_id * | string | Run id. |
after | string | Cursor: the last id of the previous page. |
limit | integer | Page size, 1 to 100. |
create_distillation Create a distillation job
Run one-call distillation (Gridline's /distillation/jobs): the teacher model answers your prompts in a batch, the answers become a fine-tuning file with held-out rows, the student base is fine-tuned on it, and (unless run_student_batch is false) the new ft: model answers the held-out prompts so you can compare it with the teacher. Give your prompts as prompts_file (a file id from upload_file, purpose "batch") or prompts (a local JSONL path this tool uploads first), not both; one prompt a line: {"messages": [...]} ending with the user's turn, or an OpenAI batch request line. Prompt baking: stud…
| Parameter | Type | Description |
|---|---|---|
student * | string | Student base model id (a fine-tune base). |
teacher * | string | Teacher model id: any chat model list_models shows for you. |
confirm_spend | boolean | Must be true for this call to run: you have read the quote or price and accept the charge. |
dry_run | boolean | true: return the quote only; no job is created and nothing is charged (a local prompts file is still uploaded, free). |
keep_truncated | boolean | Keep teacher answers cut at max_tokens in the training file (default false: they are left out, still billed). |
lora_rank | integer | LoRA rank. |
max_tokens | integer | Teacher answer limit (default 1,024 or the teacher's own limit). |
metadata | object | |
method | string | "lora" or "qlora". |
n_epochs | integer | Fine-tuning epochs (default: the student's). |
prompts | string | Local path of a prompts JSONL to upload instead of prompts_file. |
prompts_file | string | File id of the prompts (purpose batch, from upload_file). |
run_student_batch | boolean | Run the ft: model on the held-out prompts (default true). |
spend_cap_usd | number | Refuse the job if the quote's max_total_usd is over this. |
student_system | Prompt baking. Omit or null: the student trains on the prompt as the teacher saw it. "": no system message. Text: this short system message instead of yours. | |
temperature | number | Teacher temperature, 0 to 2. |
validation_split | number | Share of prompts held out, 0 up to 1 (default 0.1). |
list_distillations List distillation jobs
List your distillation jobs, newest first. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
after | string | Cursor: the last id of the previous page. |
limit | integer | Page size, 1 to 100. |
get_distillation Get a distillation job
A distillation job's status and stage, its stages' batch and fine-tune ids, costs, and the ft: model once it succeeds. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Distillation job id (distjob-...). |
list_distillation_events Distillation job events
A distillation job's stage events (transitions, newest first). Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Distillation job id (distjob-...). |
after | string | Cursor: the last id of the previous page. |
limit | integer | Page size, 1 to 100. |
cancel_distillation Cancel a distillation job
Cancel a distillation job; its current stage (a batch or fine-tune) is cancelled too. Stages already billed stay billed: read the job afterwards (get_distillation) for its final state and costs. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
id * | string | Distillation job id (distjob-...). |
request_merged_weights Export merged weights
Ask for an ft: model merged into its base as full safetensors. Free: the merge and download are at no charge; the export is kept 7 days. Poll get_merged_weights until it succeeds.
| Parameter | Type | Description |
|---|---|---|
model * | string | Your ft: model id. |
get_merged_weights Merged weights status
A merged-weights export's status and its file list. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
model * | string | Your ft: model id. |
get_merged_file_url Merged weights download URL
A short-lived (15 minute) download URL for one file of a merged-weights export. Download it with any HTTP client; the bytes are not passed through this tool. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
model * | string | Your ft: model id. |
path * | string | File path from get_merged_weights. |
login Log in
Log in to Gridline through the user's browser when no API key is set (a tool answered not_logged_in). The first call starts the login and returns verification_url and user_code: show both to the user and ask them to open the URL, sign in or sign up, check the code matches and click Approve. Call login again to wait for the approval (up to wait_seconds); it answers logged_in once the key is saved. The key is stored privately on this machine (the same file `gridline login` uses) and is never shown. Free: no charge.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Approve a new API key even if one is already set. |
wait_seconds | integer | How long a call after the first waits for the approval, 0 to 120 (default 30). |
signup Create a Gridline account
Create a Gridline account and API key for the user with no browser. Before calling it, show the user the terms of use, the job terms and the privacy policy (call with accept_terms false to get their links) and get their yes: accept_terms true accepts them on the user's behalf. The key is saved privately on this machine (the file gridline login uses) and never shown. Free. For an existing account use login instead.
| Parameter | Type | Description |
|---|---|---|
accept_terms * | boolean | True only after the user read the terms and said yes. |
email * | string | The user's email address. |
name | string | The user's name (optional). |
email_login Log in with an emailed code
Get an API key for an existing Gridline account with no browser, or renew an expiring one. Call with email only to email the user a 6-digit code; get it from their inbox if you can read it, or ask the user, then call again with email and code. The key is saved privately on this machine and never shown. Free.
| Parameter | Type | Description |
|---|---|---|
email * | string | The account's email address. |
code | string | The 6-digit code from the email. |
verify_email Verify the account email
Verify the user's email with the 6-digit code Gridline emailed them (subject "Your Gridline code": read it from their inbox if you can, otherwise ask the user). Needed before anything else: uploads, quotes, jobs and the free credit. Pass resend true to email a new code. Free.
| Parameter | Type | Description |
|---|---|---|
code | string | The 6-digit code from the email. |
resend | boolean | Email a new code instead. |
add_credit Add credit
Get a payment link for the user to add credit (at least $5): method card gives a checkout page they pay once in their browser; method usdc gives a Solana Pay URL any wallet can pay, when USDC is open. The first payment opens a new account. Creating the link charges nothing. The job terms (see signup with accept_terms false for the link) apply to buying credit: get the user's yes first.
| Parameter | Type | Description |
|---|---|---|
accept_terms * | boolean | True only after the user accepted the job terms. |
amount_usd * | integer | Whole US dollars, 5 or more. |
method * | string | card (checkout link) or usdc (Solana Pay). |
claim_free_credit Claim the free credit
Claim the free starter credit for a new account, while it lasts. Needs a verified email (verify_email) and the user's yes to the job terms. One claim per email address (+tag variants count as one) and per network. It opens the account. Free.
| Parameter | Type | Description |
|---|---|---|
accept_terms * | boolean | True only after the user accepted the job terms. |
list_keys List the account's API keys
List the account's active API keys and sessions (id, name, scopes, dates), marking the one this server uses. Never shows a key's secret. Call once without code to email the user a 6-digit code, then again with the code. The same code then works for one revoke_key of another key. Free.
| Parameter | Type | Description |
|---|---|---|
code | string | The 6-digit code from the email. |
revoke_key Revoke an API key
Revoke an API key. this_key true revokes the key this server uses and forgets it. For another key, pass its id (from list_keys) and the emailed code; with no code it emails one. Closing the account is not possible here: the user does that in the dashboard. Free.
| Parameter | Type | Description |
|---|---|---|
code | string | The 6-digit code from the email. |
id | string | Another key's id from list_keys. |
this_key | boolean | True to revoke the key this server uses. |