Repository navigation
Optimizer phase 1: batch settings, the agent's tune request, batched-bench - #43
Merged
Merged
Conversation
…bench The design is in docs/design/optimizer.md: a measured search for faster llama.cpp settings, with an optional LLM advisor that only proposes. - Model settings batch, ubatch and split_mode, with their llama-server flags, the shared form, the TUI and the console. Old --batch-size and --ubatch-size raw args move to the typed fields on load. - The host agent's tune.<model> request runs llama-bench, llama-batched-bench or a llama-server load check in a backend image, as the benchmark does. Every argument must match a pattern for its flag, so a container cannot pass a model path, a network flag or a device. - The hip, vulkan and cuda images ship llama-batched-bench. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Summary
Phase 1 of the inference optimizer. The design is in
docs/design/optimizer.md. The optimizer searches llama.cpp settings by measurement on the host's own hardware. An optional upstream LLM can propose candidates, but only a measurement decides, and the owner applies the result.This PR adds the plumbing. The search, the API and the UI come in later phases.
Changes
batch,ubatchandsplit_mode(internal/models), with--batch-size,--ubatch-sizeand--split-modein the llama-swap command. They are in the shared form, the TUI and the console.-b,--batch-size,-uband--ubatch-sizeare now typed flags, andLoadSettingsmoves old raw args into the typed fields.tune.<model>request (os/rootfs/usr/libexec/sibyl/agent). It runs one tool in a backend image with the same container options as the benchmark:llama-bench,llama-batched-bench, orllama-serveruntil/healthanswers. Every argument must match a pattern for its flag. The model path, the pool, the GPUs and the backend get fixed checks.hostctl.Tune.llama-batched-benchin thehip,vulkanandcudaimages.SIBYL_AGENT_*variables, for the tests. The systemd unit sets none.Verification
TestAgentTuneAllowlistruns the agent's allowlist on 7 good and 22 bad argument lists, such as-m /etc/shadow,-rpc,--host 0.0.0.0, a flag as a value, and an-otpattern that starts with a dash.TestAgentTuneRunsruns the whole agent with a fakepodmanfor each tool and for refused arguments. It fails when--cap-drop allis removed from the tune container options.go vet,go test -race ./...,golangci-lint(0 issues) andshellcheckpass.🤖 Generated with Claude Code