Lamini Train API

Create and manage model training jobs.

Operations 4

POST /v1/train Create a tuned model by kicking off a fine-tuning job on a base model #
GET /v1/train/jobs/{job_id} Get the status of a training job #
POST /v1/train/jobs/{job_id}/cancel Cancel a training job #
POST /v1/train/jobs/{job_id}/resume Resume a training job #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lamini:lamini-train-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lamini-train-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lamini Train API
  description: LLM inference and tuning for the enterprise. Factual LLMs. Classifier and embeddings. Deployed anywhere in 10 min.
  version: 1.13.6
security:
- APIKeyAuth: []
tags:
- name: train
  description: Create and manage model training jobs.
paths:
  /v1/train:
    post:
      tags:
      - train
      summary: Create a tuned model by kicking off a fine-tuning job on a base model
      description: 'Read more about how to use Memory Tuning to achieve very high accuracy on your evals: Memory Tuning docs.'
      operationId: train_v1_train_post
      requestBody:
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/TrainPayload'
              title: Payload
              description: Details of the training job to be created.
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - API Key Auth: []
      parameters:
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: API key for authentication
  /v1/train/jobs/{job_id}:
    get:
      tags:
      - train
      summary: Get the status of a training job
      description: You can see your jobs at https://app.lamini.ai/train
      operationId: train_status_v1_train_jobs__job_id__get
      parameters:
      - required: true
        schema:
          type: integer
          title: Job Id
        name: job_id
        in: path
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: API key for authentication
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - API Key Auth: []
  /v1/train/jobs/{job_id}/cancel:
    post:
      tags:
      - train
      summary: Cancel a training job
      description: Cancelling a training job is reversible - jobs are automatically checkpointed and you can resume them later. Canceled jobs don't affect other jobs. You can see all training jobs at https://app.lamini.ai/train
      operationId: cancel_training_job_v1_train_jobs__job_id__cancel_post
      parameters:
      - required: true
        schema:
          type: integer
          title: Job Id
        name: job_id
        in: path
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: API key for authentication
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainStatusResponse'
              example:
                status: CANCELLED
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - API Key Auth: []
  /v1/train/jobs/{job_id}/resume:
    post:
      tags:
      - train
      summary: Resume a training job
      description: Jobs are resumable until they run for all `max_steps`. You can see all training jobs at https://app.lamini.ai/train
      operationId: resume_training_job_v1_train_jobs__job_id__resume_post
      parameters:
      - required: true
        schema:
          type: integer
          title: Job Id
        name: job_id
        in: path
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: API key for authentication
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainStatusResponse'
              example:
                status: TRAINING MODEL
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - API Key Auth: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    TrainPayload:
      properties:
        model_name:
          type: string
          title: Model Name
          description: Name of the base model to use for training. Must be a valid Hugging Face model name.
          example: meta-llama/Llama-3.2-3B-Instruct
        dataset_id:
          type: string
          title: Dataset Id
          description: Previously uploaded dataset to use for training.
          example: xyz123
        finetune_args:
          allOf:
          - $ref: '#/components/schemas/FinetuneArgs'
          title: Finetune Args
          description: Fine-tuning arguments for the training job.
          example:
            max_steps: 50
            r_value: 32
            learning_rate: 0.0003
        gpu_config:
          allOf:
          - $ref: '#/components/schemas/GPUConfig'
          title: Gpu Config
          description: GPU configuration for the training job.
          default:
            gpus: 0
            nodes: 0
          example:
            gpus: 2
            nodes: 1
        custom_model_name:
          type: string
          title: Custom Model Name
          description: Descriptive name for the model.
          example: my-custom-model-name
        upload_file_path:
          type: string
          title: Upload File Path
          description: Base path to the filestore where the training dataset is stored.
        is_public:
          type: boolean
          title: Is Public
          description: Allow public access to the model and dataset.
          default: false
        id:
          type: string
          title: Id
        source:
          type: object
          title: Source
          default: {}
      type: object
      required:
      - model_name
      title: TrainPayload
    FinetuneArgs:
      properties:
        max_steps:
          type: integer
          title: Max Steps
          description: Specifies the total number of training steps to perform. This parameter is passed to [HuggingFace's Transformers TrainingArguments](https://huggingface.co/docs/transformers/v4.44.2/en/main_classes/trainer#transformers.TrainingArguments.max_steps).
          default: 100
        learning_rate:
          type: number
          title: Learning Rate
          description: 'The initial learning rate for the fine-tuning job. Usage note: see the [Memory Tuning docs](https://docs.lamini.ai/tuning/memory_tuning/) for tips on setting learning rate. This parameter is passed to [HuggingFace''s Transformers TrainingArguments](https://huggingface.co/docs/transformers/v4.44.2/en/main_classes/trainer#transformers.TrainingArguments.learning_rate).'
          default: 0.0009
        save_steps:
          anyOf:
          - type: integer
          - type: number
          title: Save Steps
          description: Number of update steps between two checkpoint saves. This parameter is passed to [HuggingFace's Transformers TrainingArguments](https://huggingface.co/docs/transformers/v4.44.2/en/main_classes/trainer#transformers.TrainingArguments.save_steps).
          default: 60
        max_finetuning_examples:
          type: integer
          title: Max Finetuning Examples
          description: Sets the maximum number of data points for fine-tuning. If not set, the model is fine-tuned on the entire dataset.
        gradient_accumulation_steps:
          type: integer
          title: Gradient Accumulation Steps
          description: 'Number of update steps to accumulate the gradients for, before performing a backward/update pass. Usage note: a higher setting can improve memory efficiency and thus reduce training time, often with a neutral effect on model accuracy. This parameter is passed to [HuggingFace''s Transformers TrainingArguments](https://huggingface.co/docs/transformers/v4.44.2/en/main_classes/trainer#transformers.TrainingArguments.gradient_accumulation_steps).'
          default: 2
        max_length:
          type: integer
          title: Max Length
          description: 'Specifies the maximum sequence length for the forward pass, acting as the block size for the model.Should be a power of 2, no larger than 8192. Usage note: `max_length` should be at least as large as the size of your datapoints. If training with large datapoints is not converging, increasing this value may help. However, larger values of `max_length` increase training time, and very large values will exhaust GPU memory. There''s often room to reduce the size of your datapoints so a smaller `max_length` can be used.'
          default: 2048
        optim:
          allOf:
          - $ref: '#/components/schemas/OptimizerType'
          description: The optimizer to use. This parameter is passed to [HuggingFace's Transformers TrainingArguments](https://huggingface.co/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments.optim).
          default: adafactor
        r_value:
          type: integer
          title: R Value
          description: Specifies the size of the LoRA (Low-Rank Adaptation) component.
          default: 64
        index_method:
          allOf:
          - $ref: '#/components/schemas/IndexType'
          description: The index method used for approximate nearest neighbor search of high-dimensional vectors.
          default: IndexIVFPQ
        index_k:
          type: integer
          title: Index K
          description: Determines the number of nearest neighbors to consider.
          default: 2
        index_max_size:
          type: integer
          title: Index Max Size
          description: Maximum size of the index.
          default: 65536
        index_pq_m:
          type: integer
          title: Index Pq M
          description: Number of factors of product quantization. Only used when `index_method` is `IndexIVFPQ` or `IndexPQ`, ignored otherwise.
          default: 8
        index_pq_nbits:
          type: integer
          title: Index Pq Nbits
          description: 'Number of bits in which each low-dimensional vector is stored. Range: [1, 16]. Only used when `index_method` is `{IndexType.IVFPQ}` or `{IndexType.PQ}`, ignored otherwise.'
          default: 8
        index_ivf_nlist:
          type: integer
          title: Index Ivf Nlist
          description: Number of buckets during clustering for IVFLAT. Only used when `index_method` is `{IndexType.IVFPQ}`, ignored otherwise.
          default: 2048
        index_ivf_nprobe:
          type: integer
          title: Index Ivf Nprobe
          description: Number of buckets to search during the first step of IVFLAT. Only used when `index_method` is `{IndexType.IVFPQ}`, ignored otherwise.
          default: 48
        index_hnsw_m:
          type: integer
          title: Index Hnsw M
          description: 'Range: [4, 64]. Used in HNSW (Hierarchical Navigable Small World Graph) algorithm. Only used when `index_method` is `{IndexType.HNSWPQ}` or `{IndexType.HNSWFlat}`, ignored otherwise.'
          default: 32
        index_hnsw_efConstruction:
          type: integer
          title: Index Hnsw Efconstruction
          description: 'Expansion factor at construction time for HNSW. Range: [8, 512]. Only used when `index_method` is `{IndexType.HNSWPQ}` or `{IndexType.HNSWFlat}`, ignored otherwise.'
          default: 16
        index_hnsw_efSearch:
          type: integer
          title: Index Hnsw Efsearch
          description: Expansion factor at search time for HNSW. Only used when `index_method` is `{IndexType.HNSWPQ}` or `{IndexType.HNSWFlat}`, ignored otherwise.
          default: 8
      type: object
      title: FinetuneArgs
    TrainResponse:
      properties:
        job_id:
          type: integer
          title: Job Id
          description: ID of the newly created training job.
          example: 123
        status:
          allOf:
          - $ref: '#/components/schemas/TrainStatus'
          description: Status of the training job.
          example: TRAINING MODEL
      type: object
      required:
      - job_id
      - status
      title: TrainResponse
    GPUConfig:
      properties:
        gpus:
          type: integer
          title: Gpus
          description: Number of GPUs per node to use for the tuning job.
          default: 0
        nodes:
          type: integer
          title: Nodes
          description: Number of nodes (machines containing multiple GPUs) to use for the tuning job.
          default: 0
      type: object
      title: GPUConfig
      description: 'GPU configuration for the training job.


        Lamini On-Demand allows a maximum of GPUs and nodes based on our server availability. If you are on Lamini Reserved or Self-Managed, you can specify any number of GPUs and nodes within your provisioned cluster size. Your job will be queued until the requested number of GPUs and nodes is available.


        If the required GPUs and nodes are not available, the configuration defaults to the system limit, and the job is queued until the resources become available. When using multiple nodes, specify the number of GPUs required per node.'
    TrainStatus:
      type: string
      enum:
      - CREATED
      - QUEUED
      - COMPLETED
      - FAILED
      - CANCELLED
      - TIMED OUT
      - LOADING DATA
      - TRAINING MODEL
      - EVALUATING MODEL
      - SAVING MODEL
      title: TrainStatus
      description: 'Indicates the state of the training job.


        `CREATED`: The training job has been created, but no training has started yet.


        `QUEUED`: The training job has been queued and is waiting for resources to become available.


        `LOADING_DATA`: Data is being loaded onto the GPUs for this training job.


        `TRAINING`: The model is being trained and adapter weights are being updated.


        `EVALUATING`: The model is being evaluated against the eval dataset.


        `SAVING_MODEL`: A model checkpoint is being saved.


        `COMPLETED`: The training job has completed successfully.


        `FAILED`: The training job has failed. The job may be resumeable.


        `CANCELLED`: The training job has been cancelled. The job may be resumeable.


        `TIMED_OUT`: The training job has timed out. The job may be resumeable.'
    OptimizerType:
      type: string
      enum:
      - adamw_hf
      - adamw_torch
      - adamw_torch_fused
      - adamw_apex_fused
      - adamw_anyprecision
      - adafactor
      title: OptimizerType
      description: Available optimizers for MoME model tuning.
    IndexType:
      type: string
      enum:
      - IndexIVFPQ
      - IndexHNSWPQ
      - IndexHNSWFlat
      - IndexFlatL2
      - IndexPQ
      title: IndexType
      description: Available indexes for MoME model tuning.
    TrainStatusResponse:
      properties:
        status:
          allOf:
          - $ref: '#/components/schemas/TrainStatus'
          description: Status of the training job.
          example: TRAINING MODEL
      type: object
      required:
      - status
      title: TrainStatusResponse
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your API token. Get your API key from http://localhost:5001/account
x-provenance:
  method: harvested
  publisher: Lamini
  source: https://docs.lamini.ai/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)