You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there some way to get all the log probs of multiple possible next tokens with the library? So far I managed to get only the probabilities for the chosen token with this example
Hi! The API already supports this: pass logprobs=k (an integer from 0 to 20) and each choice's logprobs part carries per token top_logprobs, which is a list with one {token: logprob} dict per generation step (see #452, which adds the typed response field). I opened PR #455 that makes it discoverable and safe from the request side: it documents the [0, 20] range in the create() docstrings, rejects out of range values with a clear error before the request is sent, and adds a regression test pinning that top_logprobs round trips through model_dump() without Pydantic warnings. Thanks, Rayyan
Activity
Ranoobaba commentedon Jul 21, 2026
Hi! The API already supports this: pass logprobs=k (an integer from 0 to 20) and each choice's logprobs part carries per token top_logprobs, which is a list with one {token: logprob} dict per generation step (see #452, which adds the typed response field). I opened PR #455 that makes it discoverable and safe from the request side: it documents the [0, 20] range in the create() docstrings, rejects out of range values with a clear error before the request is sent, and adds a regression test pinning that top_logprobs round trips through model_dump() without Pydantic warnings. Thanks, Rayyan
Validate logprobs range and pin top-k logprobs round-trip
Document what logprobs returns and bound it to the documented range
Document what logprobs returns and bound it to the documented range
blainekasten commentedon Sep 15, 2026
This repo is deprecated and is not taking new patches. Thanks.
The new SDK is hosted at https://github.com/togethercomputer/together-py