Add gpt-5.4 models and request options#7
Open
sderev wants to merge 1 commit into
Open
Conversation
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
lmterminal/model_registry.pyand move model aliases, pricing data, and tokenizer fallbacks into it.o3-pro, and newer Codex model names to the CLI.--reasoning-effortand repeatable-o/--option key=valuepassthrough for Chat Completions requests.gpt-5.4short vs long prompt pricing in--tokens.Why
How to test
gateuv run pytest tests/cli_test.py tests/gpt_integration_test.py tests/lib_test.pyuv run lmt modelsand confirm the new GPT-5 / Codex /o3-pronames appear.uv run lmt --tokens -m gpt-5.4 "hello"and confirm the prompt cost output includes a pricing tier line.uv run lmt -m gpt-5.4 --reasoning-effort high -o verbosity=low "hello"and confirm the request succeeds.uv run lmt -o temperature=0.9 "hello"anduv run lmt -o n=2 "hello"and confirm the CLI rejects those-ooverrides.Risk/comp notes
-o/--optionuses light parsing and relies on the OpenAI API to reject invalid model-specific combinations.lmt modelsor accepted via-m.Changelog fragment: yes