feat: add KV cache type configuration and extraArgs escape hatch#256
Merged
feat: add KV cache type configuration and extraArgs escape hatch#256
Conversation
Add cacheTypeK and cacheTypeV fields to InferenceService CRD for configuring llama.cpp KV cache quantization (--cache-type-k/v flags). Supports f16, f32, q8_0, q4_0, q4_1, q5_0, q5_1, and iq4_nl types. Add extraArgs field as an escape hatch for passing arbitrary llama-server flags not yet exposed as typed CRD fields. Both features include CLI flags (--cache-type-k, --cache-type-v, --extra-args), controller arg helpers, and full test coverage. Non-breaking: all fields are optional with empty defaults. Existing deployments are unaffected. Fixes #252, #253 Signed-off-by: Christopher Maher <chris@mahercode.io>
Moves deploy summary printing into its own function to bring runDeploy cyclomatic complexity below the gocyclo threshold of 30. Signed-off-by: Christopher Maher <chris@mahercode.io>
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
cacheTypeKandcacheTypeVfields to InferenceService CRD for KV cache quantization type configuration (maps to llama.cpp--cache-type-k/--cache-type-v)extraArgsfield as an escape hatch for arbitrary llama-server flags--cache-type-k,--cache-type-v,--extra-argsMotivated by TurboQuant benchmarking where we had to build custom wrapper images to inject cache type flags. With these CRD fields, users can configure KV cache quantization directly:
Non-breaking: all fields are optional with empty defaults.
Test plan
make testpasses (324 lines added, 6 new test cases)make manifests generateclean--cache-type-k q4_0 --cache-type-v q4_0, verify args in pod spec--extra-args="--seed,42", verify args appendedFixes #252, #253