Clarify InferenceOptions usage in README and lock the API surface#19
Open
HaD0Yun wants to merge 1 commit intoHumeAI:mainfrom
Open
Clarify InferenceOptions usage in README and lock the API surface#19HaD0Yun wants to merge 1 commit intoHumeAI:mainfrom
HaD0Yun wants to merge 1 commit intoHumeAI:mainfrom
Conversation
Issue HumeAI#15 is a docs/API alignment fix: the README should show that advanced generation controls are configured through the InferenceOptions dataclass and passed via the inference_options argument, while a small AST-based regression test protects that README-facing API surface from drifting out of sync. Constraint: Keep the change scoped to the existing issue HumeAI#15 docs/API guidance gap Rejected: Runtime API aliases for top-level kwargs | unnecessary behavior change for a documentation issue Rejected: README-only fix without regression coverage | easy for docs and API surface to drift apart Confidence: high Scope-risk: narrow Directive: Keep README inference examples aligned with tada/modules/tada.py and update tests/tada_api_surface_test.py when the generate signature or InferenceOptions defaults change Tested: git diff --check; uv run --python 3.12 pytest tests/tada_api_surface_test.py -q; static README/API compatibility check Not-tested: End-to-end model inference with downloaded weights/audio assets
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
Closes #15 by documenting the correct way to pass advanced generation controls through
InferenceOptionsin the README and by adding a small regression test that locks the README-facing API surface.Problem statement
The README quickstart showed basic
model.generate()usage, but it did not show how to configure advanced acoustic and flow-matching controls from Python. That made it easy for users to try passing values likenoise_temperature,acoustic_cfg_scale, ornum_flow_matching_stepsdirectly tomodel.generate(), which is not the supported API shape.Root cause
The runtime API already expects advanced generation controls to be bundled inside an
InferenceOptionsdataclass and passed viainference_options=..., but the main README did not surface that pattern where users look first.What changed
InferenceOptionsin the main README inference snippetCustom inference settingssection underRun InferenceInferenceOptions, not as top-levelmodel.generate()kwargsinference_options=optstests/tada_api_surface_test.pyto statically guard theInferenceOptionsdefaults and theTadaForCausalLM.generate(..., inference_options=...)signatureWhy this design
This keeps the fix narrow and reviewable:
Overlap assessment
Classification: adjacent but distinct
InferenceOptionswithmodel.generate()InferenceOptionscall patternSo this PR is complementary rather than duplicative.
Validation
git diff --check --cacheduv run --python 3.12 pytest tests/tada_api_surface_test.py -q→2 passedtada/modules/tada.py→ passedRisk / compatibility
Low risk.
Files changed
README.mdtests/tada_api_surface_test.py