The Studio host runs inside each computer’s Allternit API under /api/v1/studio. It lists training engines, runs fine-tune jobs, reports progress, and registers the results as local models. One job runs per computer at a time. Calls need a signed-in caller. Errors are always { "error": "<code>", "message": "<text>" }. From the terminal, use gizzi studio. For the user flow, see Freeweights Studio. The contract lives in services/studio-spec in the platform repository: openapi/studio-api.yaml and openapi/engine-api.yaml.

Routes

Engines

GET /engines returns { "engines": [...] }. Each engine has id, name, license, version, methods (lora, qlora, full, dpo), hardware (any of apple-silicon, cuda-linux, cuda-windows, rocm-linux, xpu-linux, xpu-windows, cpu), install_state (not_installed, installing, installed, failed), backends and fit. The default engine is allternit-tune (Apache-2.0). Its torch and mlx backends are both available. fit says whether the engine runs on this computer: POST /engines/:id/install answers 202. A build that cannot install the engine answers 501 not_available.

Create a job

The job starts in state queued (201). The spec fields are:

Job states

queued, preparing, running, exporting, succeeded, failed, cancelled. States only move forward. A job also has created_at, updated_at, error, last_seq and outputs.

Events

Poll GET /jobs/:id/events?after=<seq>. It returns the events with seq greater than after (default 0) and the current state:
kind is state, log, progress, output or error. seq starts at 1 and increases by 1 per job. Keep the highest seq you saw and pass it as after on the next poll. Stop when state is succeeded, failed or cancelled.

Outputs

GET /jobs/:id/outputs lists { kind, path, bytes } for each output. kind is adapter, merged, gguf or mlx. path is always an absolute path on the computer that ran the job, inside the output folder the host gave the engine. Outputs stay on the computer after the job ends. POST /jobs/:id/outputs/register with { "kind": "adapter", "name": "optional" } registers an output with the Local Engine and returns { "model_id": "..." }.

Error codes

A manifest that changes after the job is accepted fails the job while it is preparing, before any file downloads.

Where the engines come from

  • Allternit Tune is Apache-2.0 and ships with Allternit.
  • Axolotl, LLaMA-Factory and torchtune install through the engine kit and adapters in Allternit/studio-engines (Apache-2.0), pinned to commit e520474. Each upstream engine is installed unmodified at a pinned version: Axolotl 0.21.1 (Apache-2.0), LLaMA-Factory 0.9.5 (Apache-2.0) and torchtune 0.6.1 (BSD-3-Clause, no longer maintained upstream). Each runs as a separate process in its own environment.
  • No AGPL or LGPL engines. Unsloth is not a Studio engine: its CLI is AGPL-3.0. Allternit Tune covers LoRA, QLoRA and GGUF export.
  • Every engine is labelled “Not yet tested by Allternit on this hardware”.

How the computer installs an engine

Each engine gets its own Python environment under the Studio folder. The host:
  1. Creates the environment. Desktop uses its bundled Python 3.12. On other computers the host uses the first Python on PATH that the engine accepts: 3.10 for torchtune, 3.11 for LLaMA-Factory, 3.12 for Axolotl and 3.10 for Allternit Tune. A Python build without ensurepip still works: the host creates the environment without pip and then installs pip into it.
  2. Installs the studio-engines kit from the pinned commit’s archive (no git needed on the computer).
  3. Installs the upstream engine’s wheel at its pinned version, checked against the wheel’s SHA-256. The engine’s own dependencies install by version, from the PyTorch index for this computer’s hardware.
  4. Records what it installed (kit commit, engine version, wheel hash, hardware). A change to any of them reinstalls the engine.
The host refuses to install an engine whose fit.ok is false on this computer (hardware_not_supported).

Engine API v1

The host talks to each engine process over loopback. The host picks a free port and a per-launch token, and sends Authorization: Bearer <token> on every request. A wrong token returns 401 unauthorized. The engine runs one job at a time. The schemas are the same as above.

Run the fake engine

For client development, allternit-studio-spec has a fake engine. It walks a job through queued, preparing, running, exporting and succeeded, and records events. From the platform repository:
A second job while one runs returns 409 job_running. In Rust tests, allternit_studio_spec::fake_engine::FakeEngine::start(token, step_delay) binds a free loopback port.