> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.fastino.ai/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Start managed training (config job) with POST /v1/training/jobs using base_model. For interactive training, native JSON clients use the public operations under /v1/training/jobs and /v1/training/usage. Existing Tinker clients use tinker==0.32.0 with TINKER_BASE_URL=https://api.fastino.ai/v1/training/compat/tinker and TINKER_CREDENTIAL_CMD. Compatibility child routes are private and absent from OpenAPI. Auto Train is private access and has no public route; direct interested users to sales@fastino.ai. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Fine-tune GLiNER

> Prepare a GLiNER dataset, start managed training (config job), and monitor it through checkpoints and completion.

This guide starts managed training (`config` job). You provide a ready dataset
and training settings, and Fastino runs the training loop.

## Before you begin

Set `FASTINO_API_KEY` as shown in the [Training API overview](https://docs.fastino.ai/training.md). The
examples send it in the `X-API-Key` header and use `jq` to read JSON responses.

Owners, Admins, and Editors can complete this managed workflow. A successful
final config job deploys automatically through Fastino's server-side
post-training pipeline; it does not require the creator to hold the separate
manual-deployment permission.

## 1. Choose the task

> [card] Extraction
>
> Train GLiNER to find labeled spans such as people, products, or locations.
> Prepare `text` and `entities` rows and upload the dataset as NER data.

> [card] Classification
>
> Train GLiNER to assign one or more labels to text. Prepare `text` with
> `label` or `labels` rows and upload the dataset as classification data.

Keep one row shape throughout each JSONL file. Follow
[Prepare and upload training datasets](https://docs.fastino.ai/concepts/datasets.md) for the exact GLiNER
JSONL formats, upload-URL request, file upload, processing request, and readiness
check. Poll the exact version until it reports `ready` or `failed`. Continue
only on `ready`; on `failed`, surface `processing_error`, correct the data, and
upload a new version.

## 2. Query trainable models

Do not hard-code a base model from an old example. Query the live catalog
immediately before creating the job:

```bash theme={null}
curl -sS "https://api.fastino.ai/v1/base-models?supports_training=true" \
  -H "X-API-Key: $FASTINO_API_KEY" | jq
```

Choose a GLiNER model that supports your task and desired training type. Copy
its exact ID for the native Training API's `base_model` field.

## 3. Create a config job

Replace the catalog model, dataset name, and version below.

```bash theme={null}
curl -sS -X POST "https://api.fastino.ai/v1/training/jobs" \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "support-request-extractor",
    "base_model": "BASE_MODEL_ID_FROM_CATALOG",
    "datasets": [
      {
        "name": "READY_DATASET_NAME",
        "version": "VERSION_NUMBER"
      }
    ],
    "training_type": "lora"
  }' | tee training-job.json
```

The response is the created job record. Save its `id`:

```bash theme={null}
export TRAINING_JOB_ID="$(jq -r '.id' training-job.json)"
test "$TRAINING_JOB_ID" != "null"
```

See the [create-job API reference](https://docs.fastino.ai/api-reference/training-jobs/create.md) for
optional config-job fields.

## 4. Poll the job

Poll `GET /v1/training/jobs/{job_id}` until `is_terminal_status` is `true`:

```bash theme={null}
while true; do
  if ! JOB="$(
    curl --fail-with-body -sS \
      "https://api.fastino.ai/v1/training/jobs/$TRAINING_JOB_ID" \
      -H "X-API-Key: $FASTINO_API_KEY"
  )"; then
    echo "Could not read training job" >&2
    exit 1
  fi

  echo "$JOB" | jq -e 'has("is_terminal_status")' >/dev/null || {
    echo "Training response has no terminal-state field" >&2
    exit 1
  }

  echo "$JOB" | jq '{
    normalized_status,
    is_terminal_status,
    error_message,
    is_deployable,
    deployability_reason
  }'

  [ "$(echo "$JOB" | jq -r '.is_terminal_status')" = "true" ] && break
  sleep 10
done
```

For the config-job statuses and terminal-state guidance, see the
[Training API overview](https://docs.fastino.ai/training.md#config-job-lifecycle).

The job's `model_kind` normalizes the fine-tune as `lora` or `full`; it is
`null` when the persisted training type is not recognized. Also display every
item in `notices`. These non-blocking advisories pair a stable `code` with a
customer-facing `message`, including serving terms that may apply to full
fine-tunes:

Run `echo "$JOB" | jq '{model_kind, notices: [.notices[]? | {code, message}]}'`
to preserve both the machine-readable code and the text shown to the customer.

## 5. Inspect logs and checkpoints

Read logs when you need progress or failure details:

```bash theme={null}
curl -sS \
  "https://api.fastino.ai/v1/training/jobs/$TRAINING_JOB_ID/logs" \
  -H "X-API-Key: $FASTINO_API_KEY" | jq
```

List the checkpoints Fastino created:

```bash theme={null}
curl -sS \
  "https://api.fastino.ai/v1/training/jobs/$TRAINING_JOB_ID/checkpoints" \
  -H "X-API-Key: $FASTINO_API_KEY" | jq
```

See
[logs](https://docs.fastino.ai/api-reference/training-jobs/logs.md) and
[checkpoints](https://docs.fastino.ai/api-reference/training-jobs/checkpoints.md) for their response
fields.

## 6. Confirm automatic deployment

After training and artifact normalization succeed, a final config job deploys
automatically and reaches `deployed`. Read the job again and confirm that
status:

```bash theme={null}
curl --fail-with-body -sS \
  "https://api.fastino.ai/v1/training/jobs/$TRAINING_JOB_ID" \
  -H "X-API-Key: $FASTINO_API_KEY" | jq
```

The training job ID is the model identifier used for hosted inference. Manual
checkpoint deployment is only needed when an Owner or Admin intentionally
selects another eligible checkpoint; see
[Deploy a checkpoint](https://docs.fastino.ai/api-reference/training-jobs/deploy-checkpoint.md).

## 7. Run GLiNER inference

```bash theme={null}
curl --fail-with-body -sS \
  "https://api.fastino.ai/v1/chat/completions" \
  -H "Authorization: Bearer $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"$TRAINING_JOB_ID\",
    \"messages\": [
      {
        \"role\": \"user\",
        \"content\": \"Ada Lovelace worked in London.\"
      }
    ],
    \"schema\": {
      \"entities\": [
        {\"name\": \"person\"},
        {\"name\": \"location\"}
      ]
    }
  }" | jq -r '.choices[0].message.content | fromjson'
```

Immediately after deployment, inference can return `425`, `429`, or `503` while
serving capacity becomes available or is rate limited. Retry only those
statuses, use a non-negative integer `Retry-After` value when present, cap each
wait (for example, at 30 seconds), and stop after a bounded number of attempts
(for example, five). Fail immediately for other statuses and surface the final
response if the retry limit is reached. To wait for a cold model instead of
retrying `425`, see [Retries and model warm-up](https://docs.fastino.ai/troubleshooting/retries.md#wait-for-a-cold-model).

> [card] [Call GLiNER](https://docs.fastino.ai/inference/chat-completions.md)
>
> Use GLiNER for extraction or classification through
> `POST /v1/chat/completions`.

> [card] [Install the GLiNER agent skill](https://docs.fastino.ai/concepts/gliner-agent-skill.md)
>
> Optionally give Cursor, Claude Code, or Codex the hosted GLiNER workflow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.