Skip to content

Add gpt-5.4 models and request options#7

Open
sderev wants to merge 1 commit into
mainfrom
models-options
Open

Add gpt-5.4 models and request options#7
sderev wants to merge 1 commit into
mainfrom
models-options

Conversation

@sderev

@sderev sderev commented Apr 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • Add lmterminal/model_registry.py and move model aliases, pricing data, and tokenizer fallbacks into it.
  • Add GPT-5.3, GPT-5.4, GPT-5 Pro, o3-pro, and newer Codex model names to the CLI.
  • Add --reasoning-effort and repeatable -o/--option key=value passthrough for Chat Completions requests.
  • Apply gpt-5.4 short vs long prompt pricing in --tokens.
  • Update README, template comments, changelog fragment, and tests.

Why

  • OpenAI added new model names and GPT-5.4 long-context pricing.
  • Users need a first-class reasoning control and a generic escape hatch for newer Chat Completions options.
  • One shared registry reduces drift between model validation and prompt-cost estimation.

How to test

  • gate
  • uv run pytest tests/cli_test.py tests/gpt_integration_test.py tests/lib_test.py
  • Run uv run lmt models and confirm the new GPT-5 / Codex / o3-pro names appear.
  • Run uv run lmt --tokens -m gpt-5.4 "hello" and confirm the prompt cost output includes a pricing tier line.
  • With a valid API key, run uv run lmt -m gpt-5.4 --reasoning-effort high -o verbosity=low "hello" and confirm the request succeeds.
  • Run uv run lmt -o temperature=0.9 "hello" and uv run lmt -o n=2 "hello" and confirm the CLI rejects those -o overrides.

Risk/comp notes

  • -o/--option uses light parsing and relies on the OpenAI API to reject invalid model-specific combinations.
  • Hidden legacy price-only models remain supported by the shared pricing helpers and template-driven usage, but they are not exposed by lmt models or accepted via -m.

Changelog fragment: yes

* Add `lmterminal/model_registry.py` for aliases, pricing, and tokenizer fallbacks.
* Add GPT-5.3, GPT-5.4, GPT-5 Pro, `o3-pro`, and newer Codex model names.
* Add `--reasoning-effort` and `-o/--option key=value` for Chat Completions.
* Apply `gpt-5.4` short vs long prompt pricing in `--tokens`.
* Update README, template comments, changelog fragment, and tests.

Summary: This keeps model support and prompt pricing in one registry and exposes request controls without hardcoding each new Chat Completions field.

Co-authored-by: AI <ai@sderev.com>
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.

1 participant