RL

Forward pass

Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample.

post/rl/training-sessions/{session_id}/operations/forward

Path parameters

session_idstring required

Training session ID

Request body

Example request

{
  "samples": [
    {
      "model_input": {
        "chunks": [
          {
            "encoded_text": {
              "tokens": [
                123,
                456,
                789
              ]
            }
          }
        ]
      },
      "routed_experts": {
        "shape": [
          "512",
          "64",
          "8"
        ]
      }
    }
  ]
}

Response

idstring required

Operation ID

status'TRAINING_OPERATION_STATUS_UNSPECIFIED' | 'TRAINING_OPERATION_STATUS_PENDING' | 'TRAINING_OPERATION_STATUS_RUNNING' | 'TRAINING_OPERATION_STATUS_COMPLETED' | 'TRAINING_OPERATION_STATUS_FAILED' required

Example response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "output": {
    "logprobs": [
      {
        "data": [
          -1.2,
          -0.8,
          -1.5,
          -0.9,
          -1.1
        ]
      }
    ]
  },
  "error": {
    "message": "Operation timed out"
  }
}

Changes

Changed in 6 of the 15 revisions of this API.101012

  • d8f688ad4165111See the full diff
    • added the new required request property //

      new-required-request-property

    • removed the request property //

      request-property-removed

    • added the new optional request property //

      new-optional-request-property

    This revision also has 10 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property ////

      new-optional-request-property

    • the request property //// became optional

      request-property-became-optional

  • f26a23fab8e0121See the full diff
    • request property ///// list-of-types was narrowed by removing types integer and string from media type application/json

      request-property-list-of-types-narrowed

    • the ///// request property's min was set to 0.00

      request-property-min-set

    • removed the request property //

      request-property-removed

    • added the new optional request property ///

      new-optional-request-property

    • added the new TRAINING_OPERATION_ERROR_CODE_NON_FINITE_LOSS enum value to the / response property for the response status

      response-property-enum-value-added

  • 9ccc57e5e4b9761See the full diff
    • added the new required request property ////

      new-required-request-property

    • added the new required request property ////

      new-required-request-property

    • added the new required request property ////

      new-required-request-property

    • added the new required request property ////

      new-required-request-property

    • added the new required request property ////

      new-required-request-property

    • the request property ///// became required

      request-property-became-required

    • the request property // became required

      request-property-became-required

    • removed the request property ////

      request-property-removed

    • removed the request property ////

      request-property-removed

    • removed the request property ////

      request-property-removed

    • removed the request property ////

      request-property-removed

    • removed the request property ///

      request-property-removed

    • removed the request property ////

      request-property-removed

    • added the new optional request property ///

      new-optional-request-property

    This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 0c4fdad7743517See the full diff
    • the //// response's property format changed from float to no format for status

      response-property-type-changed

    • added the new optional request property ///

      new-optional-request-property

    • added the new optional request property ///

      new-optional-request-property

    • added the new optional request property ///

      new-optional-request-property

    • added the new optional request property ///

      new-optional-request-property

    • the ////// request property format was generalized from float to no format

      request-property-type-generalized

    • the ////// request property format was generalized from float to no format

      request-property-type-generalized

    • the ////// request property format was generalized from float to no format

      request-property-type-generalized

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog