## TL;DR

Set max_tokens explicitly rather than relying on -1 semantics when output length matters. After swapping base_url to the Cerebras endpoint, verify the model ID against GET /v1/models instead of trusting memory or another provider's naming.

## Steps

1. After swapping base_url to the Cerebras endpoint, verify the model ID against GET /v1/models instead of trusting memory or another provider's naming. Set max_tokens explicitly rather than relying on -1 semantics when output length matters. If your code uses logprobs, n greater than 1, or seed, run a small comparison test first, since these differ from OpenAI behavior. Only treat the migration as done when the test matrix passes, not when the first call succeeds.

## When to use

You are seeing this: Only treat the migration as done when the test matrix passes, not when the first call succeeds. Use this skill when you run into "Cerebras OpenAI SDK migration: exact model IDs, max_tokens, logprobs differ".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
