feat(llm): add top_p, top_k, temperature sampling parameters#283
Open
ScarletCarpet wants to merge 1 commit into
Open
feat(llm): add top_p, top_k, temperature sampling parameters#283ScarletCarpet wants to merge 1 commit into
ScarletCarpet wants to merge 1 commit into
Conversation
Contributor
|
🔍 OpenCodeReview found 10 issue(s) in this PR.
📊 Posting Statistics:
|
Brief: Add three commonly-used LLM sampling parameters (top_p, top_k, temperature) with support from both CLI flags and provider config. This improves the stability of LLM outputs but requires considering the trade-offs. Test: - test on deepseekv4 with temp=0.0 and top_p=0.8 and review the same code it got 80% similarity of output. - there is no param field on http request to LLM without customlize temp/topp/topk Change Log: - Add fields to ChatRequest, ClientConfig, and both OpenAI/Anthropic clients - Add ApplyDefaults() to fill unset fields from ClientConfig - Add provider config fields for built-in and custom providers - Add CLI flags --top-p, --top-k, --temperature for review and scan commands - Add config set support for providers.<name>.top_p, top_k, temperature - Propagate params through agent.Args → llmloop.Deps → ChatRequest - Update all ChatRequest call sites (plan, main loop, compression, dedup, summary, relocation, llm test) - Update README.md and README.zh-CN.md with new configuration items and CLI flags - Add unit tests for ApplyDefaults, build params, resolver, config set, and flag parsing Discussion: - Suggest deprecating the LLM config, as it duplicates the provider config - One way to set the temperature without this commit is via extra_body, but it is less elegant - Suggest deprecating other languages' READMEs, keeping only English and Chinese to reduce the maintenance workload
41d3678 to
9ce7288
Compare
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.
Brief:
Add three commonly-used LLM sampling parameters (top_p, top_k, temperature) with support from both CLI flags and provider config. This improves the stability of LLM outputs but requires considering the trade-offs.
Test:
Change Log:
Discussion:
Description
Type of Change
How Has This Been Tested?
make testpasses locallyChecklist
go fmt,go vet)Related Issues