Repository navigation
docs(cli): describe the real smartapply model fallback (openai/gpt-4.1-mini) - #27
Merged
Merged
Conversation
mikkel
marked this pull request as ready for review
October 23, 2026 00:28
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.
Docs only, in
docs/cli.md. The CLI docs described the smartapply model fallback incorrectly. They said--applymodel/GPTDIFF_SMARTAPPLY_MODELfall back to--model/GPTDIFF_MODEL, but they don't.What the code does (
smart_apply_patchinpatchling/core.py, used by--apply)--applymodel, elseGPTDIFF_SMARTAPPLY_MODELif it is set and non-blank, else the hardcodedopenai/gpt-4.1-mini.--modelandGPTDIFF_MODELare never used for the apply step. The existing--applymodelhelp text incore.pyalready saysopenai/gpt-4.1-mini.GPTDIFF_SMARTAPPLY_API_KEY, elseGPTDIFF_LLM_API_KEY.GPTDIFF_SMARTAPPLY_BASE_URL, elseGPTDIFF_LLM_BASE_URL, elsehttps://nano-gpt.com/api/v1/.+++ /dev/null), which are removed directly. Each request uses--max_tokens.smartapply()does not read theGPTDIFF_SMARTAPPLY_*variables. It uses itsmodelargument, elseGPTDIFF_MODEL, elseDEFAULT_MODEL, and it tries a deterministic patch before calling the model. The docs now say this, so CLI and library behavior aren't confused.openai/gpt-4.1-miniis on NanoGPT's public model list ($0.40 / $1.60 per 1M input / output tokens, 2026-10-21).Verified locally (no network, no spend)
An offline probe ran
smart_apply_patchwith a stubbed apply call (probe-apply.outin the Ember pack):--modelandGPTDIFF_MODELset)openai/gpt-4.1-miniGPTDIFF_SMARTAPPLY_MODELopenai/gpt-4.1-miniGPTDIFF_SMARTAPPLY_MODELset--applymodeland env both set--applymodelvalueGPTDIFF_SMARTAPPLY_BASE_URLsetopenai/gpt-4.1-miniGPTDIFF_LLM_BASE_URLsetopenai/gpt-4.1-miniIn every case the deleted file was removed without a model call.
Other checks: pytest (offline,
fake_tiktoken) gives 207 passed, 2 skipped, the same as main.mkdocs build --strictpasses.Notes
GPTDIFF_SMARTAPPLY_MODELline indocs/cli.md(gpt5-mini→openai/gpt-5-mini). Whichever merges second will conflict on that one line and needs a rebase. This PR's wording drops the recommendation entirely, so it can win.GPTDIFF_SMARTAPPLY_MODELas CLI-only, with defaultopenai/gpt-4.1-miniand no fallback toGPTDIFF_MODEL.docs/api.md, the smartapply variables paragraph is rewritten in two parts: the library (modelargument, thenGPTDIFF_MODEL, thenDEFAULT_MODEL; key and base URL from arguments, thenGPTDIFF_LLM_*) and the CLI-onlyGPTDIFF_SMARTAPPLY_*variables.smartapply()with a stubbed model call confirms that it ignoresGPTDIFF_SMARTAPPLY_*(probe-lib.outin the pack).docs/api.mdGPTDIFF_SMARTAPPLY_MODELbullet, so whichever PR merges second rebases those lines too. docs(cli): describe the real smartapply model fallback (openai/gpt-4.1-mini) #27's wording should win.No code changes, version bump, tag, or publish.