IBM Cloud API Docs

Red Hat AI InstructLab on IBM Cloud API Reference

Introduction

With Red Hat AI InstructLab, you can use an existing, pre-trained LLM compiled by a community of contributors, and then generate the data to further train the model. By incorporating IBM Cloud, you have a place to store the taxonomy, which is the informational structure, for the model as you modify and train it on an ongoing basis.

Before you begin

Make sure that you have access to a paid IBM Cloud account.

Charges

For more information about charges, see the billing FAQ.

Authentication

The Red Hat® AI InstructLab on IBM Cloud® API uses Identity and Access Management (IAM) to authenticate requests. Pass a bearer and a refresh token in an Authorization header. Tokens support authenticated requests without embedding service credentials in every call.

Authorization

You must be authorized to work with the service in Identity and Access Management (IAM). The service uses IAM platform and service access roles to determine your permissions and the actions that you can perform.

API endpoint

Use the following API endpoint for all API requests:

https://us-east.instructlab.ibm.com/v1/

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response is some sort of failure, and a 500 type response usually indicates an internal system error.

HTTP error code descriptions.
HTTP error code Description Recovery
200 Success The request was successful.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access the resource. Check that you have the correct access credentials and permissions.
404 Not Found The requested resource could not be found.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The resource with the same name or ID already exists.
500 Internal Server Error The service is currently unavailable. Your request could not be processed. Wait a few minutes and try again. If you still encounter this problem, note the incident ID and contact IBM Cloud support.

Methods

Create taxonomy

Add a taxonomy to your Cloud Object Storage bucket.

POST /taxonomies

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.taxonomy.create

Auditing

Calling this method generates the following auditing event.

  • instructlab.taxonomy.create

Request

Taxonomy resource

Response

Taxonomy object

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-taxonomy-name-1",
      "taxonomy_path_cos": "taxonomies/taxonomy.tar.gz",
      "created_at": "2024-10-23T02:58:50.000Z",
      "tokens": {
        "data_tokens_estimated": 1000000
      },
      "cos_bucket_information": {
        "bucket": "example-bucket-1",
        "endpoint": "https://s3.us-east.cloud-object-storage.appdomain.cloud"
      },
      "secrets_manager_config": {
        "url": "https://12345678-abcd-1234-5678-abcdefghijkl.us-east.secrets-manager.appdomain.cloud",
        "git_id": "d9428888-122b-11e1-b85c-61cd3cbb3210"
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/taxonomies/202a03c4-dcf1-432a-82b7-abecb2e019f7"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

List taxonomies

Lists the details of a collection of taxonomy resources.

GET /taxonomies

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.taxonomy.list

Auditing

Calling this method generates the following auditing event.

  • instructlab.taxonomy.list

Request

No Request Parameters

This method does not accept any request parameters.

Response

List the taxonomies in your IntructLab project.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "taxonomies": [
        {
          "id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
          "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
          "name": "example-taxonomy-name-1",
          "taxonomy_path_cos": "taxonomies/taxonomy.tar.gz",
          "created_at": "2024-10-23T02:58:50.000Z",
          "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/taxonomies/202a03c4-dcf1-432a-82b7-abecb2e019f7"
        }
      ]
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Get taxonomy

Gets the details of a taxonomy resource.

GET /taxonomies/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.taxonomy.read

Auditing

Calling this method generates the following auditing event.

  • instructlab.taxonomy.read

Request

Path Parameters

  • Unique Identifier to a taxonomy

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Taxonomy object

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-taxonomy-name-1",
      "taxonomy_path_cos": "taxonomies/taxonomy.tar.gz",
      "created_at": "2024-10-23T02:58:50.000Z",
      "tokens": {
        "data_tokens_estimated": 1000000
      },
      "cos_bucket_information": {
        "bucket": "example-bucket-1",
        "endpoint": "https://s3.us-east.cloud-object-storage.appdomain.cloud"
      },
      "secrets_manager_config": {
        "url": "https://12345678-abcd-1234-5678-abcdefghijkl.us-east.secrets-manager.appdomain.cloud",
        "git_id": "d9428888-122b-11e1-b85c-61cd3cbb3210"
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/taxonomies/202a03c4-dcf1-432a-82b7-abecb2e019f7"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Delete taxonomy

Deletes a taxonomy resource.

DELETE /taxonomies/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.taxonomy.delete

Auditing

Calling this method generates the following auditing event.

  • instructlab.taxonomy.delete

Request

Path Parameters

  • Unique Identifier to a taxonomy

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Generate data

Generates data against a specified taxonomy resource.

POST /data

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.sdgdata.create

Auditing

Calling this method generates the following auditing event.

  • instructlab.sdgdata.create

Request

Data resource

Response

Data object

Status Code

  • Accepted

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-data-1",
      "state": "",
      "status": "queued",
      "created_at": "2024-10-23T02:58:50.000Z",
      "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "data_metrics": {
        "samples": {
          "additionalProp1": 1,
          "additionalProp2": 2,
          "additionalProp3": 3
        }
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35/data/add785e6-a8c3-4f5f-ab89-c506a3f115da"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

List data

Lists the details of a collection of data resources.

GET /data

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.sdgdata.list

Auditing

Calling this method generates the following auditing event.

  • instructlab.sdgdata.list

Request

No Request Parameters

This method does not accept any request parameters.

Response

List of synthetic data generation jobs.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "data": [
        {
          "id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
          "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
          "name": "example-data-1",
          "state": "",
          "status": "queued",
          "created_at": "2024-10-23T02:58:50.000Z",
          "completed_at": "2024-10-23T03:58:50.00Z",
          "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
          "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/data/202a03c4-dcf1-432a-82b7-abecb2e019f7"
        }
      ]
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Get data

Gets the details of a data resource.

GET /data/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.sdgdata.read

Auditing

Calling this method generates the following auditing event.

  • instructlab.sdgdata.read

Request

Path Parameters

  • Unique Identifier to data run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Data object

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-data-1",
      "state": "",
      "status": "completed",
      "created_at": "2024-10-23T02:58:50.000Z",
      "completed_at": "2024-10-23T03:58:50.00Z",
      "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "data_metrics": {
        "samples": {
          "additionalProp1": 1,
          "additionalProp2": 2,
          "additionalProp3": 3
        },
        "tokens": {
          "data_tokens_total": 1000000,
          "data_leaf_nodes": {
            "additionalProp1": 300000,
            "additionalProp2": 450000,
            "additionalProp3": 250000
          },
          "training_estimated": 50000000,
          "training_phases": {
            "phase_1_knowledge": 5000000,
            "phase_2_skills": 5000000
          }
        }
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/data/202a03c4-dcf1-432a-82b7-abecb2e019f7"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Delete data

Deletes a data resource.

DELETE /data/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.sdgdata.delete

Auditing

Calling this method generates the following auditing event.

  • instructlab.sdgdata.delete

Request

Path Parameters

  • Unique Identifier to data run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Cancel data

Cancels the generation of synthetic data.

POST /data/{id}/cancel

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.sdgdata.stop

Auditing

Calling this method generates the following auditing event.

  • instructlab.sdgdata.stop

Request

Path Parameters

  • Unique Identifier to data run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Train model

Trains a model against the specified synthetic data.

POST /models

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.model.create

Auditing

Calling this method generates the following auditing event.

  • instructlab.model.create

Request

Model training request object.

Response

Model Train Object. InstructLab implements a multiphase training process to incrementally improve the model's performance. This process involves first training the model with knowledge samples, and then using the newly acquired knowledge to train the model in developing additional skills.

Status Code

  • Accepted

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "baa8cfb5-e306-4e15-869d-735b74b1919d",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-model-1",
      "state": "",
      "status": "queued",
      "created_at": "2024-10-23T02:58:50.000Z",
      "data_id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
      "base_model": "granite-7b",
      "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "model_metrics": {
        "mmlu": {
          "overall_average": 0.3,
          "scores": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "mmlu_branch": {
          "error_rate": 0.4,
          "improvements": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "regressions": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "no_change": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "mt_bench": {
          "overall_average": 0.8,
          "error_rate": 0.6,
          "scores": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "mt_bench_branch": {
          "error_rate": 0.4,
          "improvements": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "regressions": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "no_change": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        }
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/models/202a03c4-dcf1-432a-82b7-abecb2e019f7"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

List models

Lists your model resources.

GET /models

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.model.list

Auditing

Calling this method generates the following auditing event.

  • instructlab.model.list

Request

No Request Parameters

This method does not accept any request parameters.

Response

A collection of model training processes for an InstructLab project.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "models": [
        {
          "id": "baa8cfb5-e306-4e15-869d-735b74b1919d",
          "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
          "name": "example-model-1",
          "state": "",
          "status": "queued",
          "created_at": "2024-10-23T02:58:50.000Z",
          "completed_at": "2024-10-23T03:58:50.00Z",
          "data_id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
          "base_model": "granite-7b",
          "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
          "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/models/202a03c4-dcf1-432a-82b7-abecb2e019f7"
        }
      ]
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Get model

Gets the details of a model.

GET /models/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.model.read

Auditing

Calling this method generates the following auditing event.

  • instructlab.model.read

Request

Path Parameters

  • Unique Identifier to a model training run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Model Train Object. InstructLab implements a multiphase training process to incrementally improve the model's performance. This process involves first training the model with knowledge samples, and then using the newly acquired knowledge to train the model in developing additional skills.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "id": "baa8cfb5-e306-4e15-869d-735b74b1919d",
      "project_id": "bdcd0181-7f5d-4bfb-be54-ef2af8cf7a35",
      "name": "example-model-1",
      "state": "",
      "status": "completed",
      "created_at": "2024-10-23T02:58:50.000Z",
      "completed_at": "2024-10-23T03:58:50.00Z",
      "data_id": "add785e6-a8c3-4f5f-ab89-c506a3f115da",
      "base_model": "granite-7b",
      "taxonomy_id": "202a03c4-dcf1-432a-82b7-abecb2e019f7",
      "model_metrics": {
        "mmlu": {
          "overall_average": 0.3,
          "scores": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "mmlu_branch": {
          "error_rate": 0.4,
          "improvements": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "regressions": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "no_change": {
            "additionalProp1": 1,
            "additionalProp3": 3,
            "additionalProp2": 2
          }
        },
        "mt_bench": {
          "overall_average": 0.8,
          "error_rate": 0.6,
          "scores": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "mt_bench_branch": {
          "error_rate": 0.4,
          "improvements": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "regressions": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          },
          "no_change": {
            "additionalProp1": 1,
            "additionalProp2": 2,
            "additionalProp3": 3
          }
        },
        "tokens": {
          "training_estimated": 50000000,
          "training_total": 50000000,
          "training_phases": {
            "phase_1_knowledge": 20000000,
            "phase_2_skills": 30000000
          }
        }
      },
      "href": "https://us-east.instructlab.ibm.com/v1/projects/baa8cfb5-e306-4e15-869d-735b74b1919d/models/202a03c4-dcf1-432a-82b7-abecb2e019f7"
    }
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Delete model

Delete a model.

DELETE /models/{id}

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.model.delete

Auditing

Calling this method generates the following auditing event.

  • instructlab.model.delete

Request

Path Parameters

  • Unique Identifier to a model training run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }

Cancel model

Cancels the training of a model.

POST /models/{id}/cancel

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • instructlab.model.stop

Auditing

Calling this method generates the following auditing event.

  • instructlab.model.stop

Request

Path Parameters

  • Unique Identifier to a model training run

    Possible values: length = 36, Value must match regular expression ^[a-z0-9-]+$

    Example: 817bc95a-fef0-4039-b936-e0b6fb17b723

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

Example responses
  • {
      "errors": [
        {
          "id": "EQI6N2",
          "code": "invalid_request",
          "message": "Invalid request.",
          "more_info": "",
          "target": {
            "type": "field",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 400
    }
  • {
      "errors": [
        {
          "id": "E5P4UX",
          "code": "unauthorized",
          "message": "Unauthorized.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 401
    }
  • {
      "errors": [
        {
          "id": "EDKHR1",
          "code": "forbidden",
          "message": "Forbidden.",
          "more_info": "",
          "target": {
            "type": "header",
            "name": ""
          }
        }
      ],
      "trace": "d56f6808-d25e-438b-a1a6-c8424453c616",
      "status_code": 403
    }
id=curlclassName=tab-item-selected