You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(llm): add top_p, top_k, temperature sampling parameters
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
0 commit comments