@noetaris/harness-openai-models
v0.2.2
Published
OpenAI model facts (context window, cache-breakpoint support) for @noetaris/harness
Readme
@noetaris/harness-openai-models
Facts about OpenAI models, looked up by model ID, for @noetaris/harness-openai. No runtime dependencies.
pnpm add @noetaris/harness-openai-modelsRequires Node.js ≥ 22.
API
import { getContextWindow, acceptsCacheBreakpoints } from '@noetaris/harness-openai-models'
getContextWindow('gpt-5.5') // 1050000
getContextWindow('gpt-5-chat-latest') // 128000
getContextWindow('my-deployment') // undefined
acceptsCacheBreakpoints('gpt-5.6-terra') // true
acceptsCacheBreakpoints('gpt-5.5') // false
acceptsCacheBreakpoints('my-deployment') // truegetContextWindow(modelId)— the context window in tokens, orundefinedwhen the ID is not in the table (the size is unknown). The match is exact: dated snapshots are listed one by one, and a fine-tune (ft:…) is not resolved to its base model. The values come from the model pages at developers.openai.com/api/docs/models, read in November 2026.acceptsCacheBreakpoints(modelId)— whether the model acceptsprompt_cache_breakpointon content parts, which OpenAI supports from gpt-5.6 on. It returnsfalseonly for models known by name to be older: gpt-3.5, gpt-4.x, chatgpt-, o1/o3/o4, and gpt-5 through gpt-5.5, with their suffixed and dated forms. It also returnsfalseforchat-latest. A fine-tune (ft:<base>:…) is judged by its base model. Any other ID returnstrue, so new models and Azure deployment names get the field.
The two functions treat an unknown ID differently on purpose: an unknown context window is left out, but an unknown model must not lose cache breakpoints.
