Skip to content

docs: show local token log probabilities - #359

Open
VedanthB wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
VedanthB:docs/local-inference-logprobs
Open

VedanthB wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
VedanthB:docs/local-inference-logprobs

Conversation

@VedanthB

@VedanthB VedanthB commented Dec 3, 2026

Copy link
Copy Markdown

Summary

Add a runnable local-inference example for retrieving token log probabilities. It uses a public SmolLM2 checkpoint and shows where to read the token entries from the OpenAI Python SDK. The guide also describes when scores can be missing.

Fixes #182.

Verification

  • Ran the README's Python block against the installed optillm --approach none CLI on macOS with OpenAI Python SDK 3.63.0. The chat endpoint returned HTTP 200 with 16 token entries, 15 finite selected-token scores, three finite alternatives per scored entry, and one entry with both score fields set to null.
  • Repeated the request against the Flask route directly and confirmed the same response shape. Both runs used SmolLM2-135M-Instruct at revision 12fd25f cached locally, with the Hub offline during inference.
  • git diff --check passed.

Drafted and verified with Codex.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

optillm supports logits or logprobs in the API

2 participants