Skip to content

update API doc for random seed param#222

Open
jli-together wants to merge 2 commits intomainfrom
jli/random-seed
Open

update API doc for random seed param#222
jli-together wants to merge 2 commits intomainfrom
jli/random-seed

Conversation

@jli-together
Copy link

@jli-together jli-together commented Mar 5, 2026

Note

Low Risk
Low risk documentation-only change in openapi.yaml adding a new optional field to the published API schema.

Overview
Documents a new random_seed parameter in openapi.yaml for fine-tuning: it can be provided on job creation and is also surfaced in job details as nullable.

The schema describes random_seed as a numeric string (e.g. "42") used to make training runs reproducible.

Written by Cursor Bugbot for commit ce8d086. This will update automatically on new commits. Configure here.

@jli-together jli-together requested review from fdrose and sadreamer March 5, 2026 23:34
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

✱ Stainless preview builds

This PR will update the togetherai SDKs with the following commit message.

feat: update API doc for random seed param

Edit this comment to update it. It will appear in the SDK's changelogs.

togetherai-openapi studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅

togetherai-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ⏭️

pip install https://pkg.stainless.com/s/togetherai-python/6ceb970f9a3679e1c4f222a225d5d7d270706983/together-2.2.0-py3-none-any.whl
togetherai-go studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

go get github.com/stainless-sdks/togetherai-go@d84a12db78b03c0a77e4e8196f731b1d838d7067
togetherai-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ❗lint ❗test ✅

togetherai-terraform studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅lint ❗test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-09 23:10:52 UTC

@mryab mryab requested review from newokaerinasai and removed request for fdrose March 6, 2026 08:32
openapi.yaml Outdated
description: Weight decay. Regularization parameter for the optimizer.
random_seed:
type: integer
description: Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If not provided, a default seed `42` is used.
Copy link

@sadreamer sadreamer Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. should it contain default: null as well (since optional)?
  2. Do we want to explicitly mention 42 here?
  3. Do we want to leave an option for non-deterministic (as it was before), e.g. when "-1" is passed (but it'll require some tweaks on the backend)? Imho not, a user can do random_seed=randint() themselves if they really want it, but it's not a strong opinion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yes will update.
  2. Maybe we should? If user wants to run a different random value besides of the default one they need to know it's 42.
  3. I think user can do random_seed=randint() if they want to randomize the experiments.

openapi.yaml Outdated
default: 0.0
description: Weight decay. Regularization parameter for the optimizer.
random_seed:
type: integer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, we still have string type in the backend, so iiuc it won't work if a client send int value

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right after I checked again the backend does expect string type. Not related to this PR but do we consider to update backend to support int type instead for random seed param?

description: Weight decay value used
random_seed:
type: integer
nullable: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure it's nullable? I thought we always explicitly set some random_seed from now on

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After double check, the API model allows empty value for this. It's the backend who sets the default.

type: number
format: float
description: Weight decay value used
random_seed:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw it's not shown in the UI, probably we need to create a dependency for FE. But not 100% sure we want to show it there

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry what does FE stand for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's nice to have if you meant frontend.

openapi.yaml Outdated
random_seed:
type: integer
nullable: true
description: Random seed used for reproducible training, if set

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, if set - again, we always set it a specific value now, even if not passed explicitly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I thought the nullable here is for the client who called this API. They don't need to set any value. It will be default to 42 behind though.

openapi.yaml Outdated
format: float
description: Weight decay value used
random_seed:
type: integer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also a type mismatch, currently we return string, not integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants