Repository navigation
Move the agent and extraction to gpt-6-luna - #4
Merged
Merged
Conversation
OpenAI shut down gpt-4.1-nano, the extraction default, on 23 October 2026, and shuts down gpt-4.1-mini, the chat default, on 14 January 2027. Both now default to gpt-6-luna, OpenAI's listed replacement. - gpt-6-luna is a reasoning model. Reasoning stays off, so it accepts temperature 0 and tool calls on the chat completions API. - Prices cite OpenAI's pricing page. The retired models' prices are removed. - The dry run estimate falls back to o200k_base, since tiktoken has no entry for gpt-6-luna. - make check flags a model with no price, such as a retired model named in an older .env. - Tests use the default models whatever .env names, and check the real requests through a local stub of the API. - docs/decisions.md records this choice, the DuckDB lockdown and the cost restore on rebuild.
gpt-6-luna writes any prompt of 1,024 tokens or more to OpenAI's prompt cache by default. It bills those tokens at 1.25 times the input rate, and tokens read back from the cache at a tenth of it. The cost lines priced every prompt token as plain input, so they under-reported new prompts. - token_cost takes the cache read and write counts, and usage_cost prices the usage metadata a reply reports. Extraction and the evaluation sum the usage with LangChain's add_usage and price each reply as it arrives, so a model with no price stops a run after one call. - The free extraction estimate is an upper bound at the cache write rate. - The missing-price error says how to fix a stale model line in .env. - docs/decisions.md explains temperature, OpenAI's two interfaces and the token encoding, describes the agent's job in full, links the caching guide and the deployment checklist, and corrects the price ratios. - The README lists OpenAI's pricing and deprecations pages. - Tests clear OPENAI_PROXY, which ChatOpenAI refuses next to a stub client. 133 tests pass offline with an empty tiktoken cache. The stub extraction test fails on the previous code, which reported $0.0000075 instead of $0.0000085.
- Both chat requests name OpenAI's standard service tier, whose prices MODEL_PRICES lists. Left unset, a request takes the tier set in the OpenAI project, and langchain-openai renames the cache counts of priority and flex replies, so the reported cost would be wrong. - Extraction and the evaluation check the model's price before the first paid call, so an unpriced model costs nothing. Extraction prices the summed usage once, at the end. - The free extraction figure is called an estimate, not a maximum. It leaves out the schema sent with each request and assumes one prompt length for every project. - The stub reports cache reads as well as writes, the cost tests use literal dollar figures, and the evaluation test covers its cache line. - docs/decisions.md records the service tier, explains prompts and the cache, and lists switching off cache writes as an alternative. The README cites the prompt caching guide. 135 tests pass offline with an empty tiktoken cache.
…e estimate The README and the decision record now say that no request has gone to gpt-6-luna, so neither OpenAI accepting the settings nor the reported costs have been checked against the live API. The decision record attributes each model claim to the OpenAI page it comes from, and notes that the newer Sol models can't switch reasoning off. The three projects to check by hand are described as outside the default sample. The extraction dry run now adds the reply schema's tokens to each prompt, and a test pins the estimate's token count and its cache-write pricing. Temperature moves into src/config.py beside the other request settings.
Owner
Author
|
Evidence for dd22c3c: the checks job passed on Python 3.11 and 3.14 (run 46519704130), and the timing API reports 0 billable milliseconds on both jobs. Locally, |
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.
Problem
OpenAI shut down
gpt-4.1-nano, the extraction model, on 23 October 2026, and shuts downgpt-4.1-mini, the agent model, on 14 January 2027. The code also priced every prompt token at the plain input rate, although OpenAI bills the tokens it writes to and reads from its prompt cache at their own rates.What changes
gpt-6-luna, OpenAI's listed replacement forgpt-4.1-mini, with its reasoning off, temperature 0 and the standard service tier, on Chat Completions. These settings and the model prices live insrc/config.py.docs/decisions.mdgives the reasons and the alternatives..envthat has none.mainup to Correct the report check count and the PDF reader timing #7, with this PR's README and documentation changes re-applied to the rewritten files.Not yet checked against OpenAI's live API
I have no OpenAI credits at the moment, so this merges without a paid run. No request has gone to
gpt-6-luna. So it isn't yet confirmed that OpenAI accepts these settings, that the reported costs match OpenAI's bill, or how accurate the extraction and the answers are. The README's limitations and the decision record say so. Once there are credits, the paid steps come first:make embed,make extract, the checks of AC2-093, AF1-236 and AF2-353 against the figures I read from their reports by hand, andmake eval.Verification
make test: 160 passed on Python 3.13, offline, with OpenAI replaced by a stand-in. CI runs the same tests on Python 3.11 and 3.14.make extracthas nothing to do until the reports are embedded.python -m src.cli askgives the fixed dry-run reply, andmake evalwires all six questions. The embedding step is unchanged.src/config.pymatch them.