Skip to content

Clarify InferenceOptions usage in README and lock the API surface#19

Open
HaD0Yun wants to merge 1 commit intoHumeAI:mainfrom
HaD0Yun:codex/issue-15-inference-options-readme-clean
Open

Clarify InferenceOptions usage in README and lock the API surface#19
HaD0Yun wants to merge 1 commit intoHumeAI:mainfrom
HaD0Yun:codex/issue-15-inference-options-readme-clean

Conversation

@HaD0Yun
Copy link
Copy Markdown

@HaD0Yun HaD0Yun commented Mar 22, 2026

Summary

Closes #15 by documenting the correct way to pass advanced generation controls through InferenceOptions in 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 like noise_temperature, acoustic_cfg_scale, or num_flow_matching_steps directly to model.generate(), which is not the supported API shape.

Root cause

The runtime API already expects advanced generation controls to be bundled inside an InferenceOptions dataclass and passed via inference_options=..., but the main README did not surface that pattern where users look first.

What changed

  • imported InferenceOptions in the main README inference snippet
  • added a new Custom inference settings section under Run Inference
  • documented that these controls belong in InferenceOptions, not as top-level model.generate() kwargs
  • included a concrete example using inference_options=opts
  • added tests/tada_api_surface_test.py to statically guard the InferenceOptions defaults and the TadaForCausalLM.generate(..., inference_options=...) signature

Why this design

This keeps the fix narrow and reviewable:

Overlap assessment

Classification: adjacent but distinct

So this PR is complementary rather than duplicative.

Validation

  • git diff --check --cached
  • uv run --python 3.12 pytest tests/tada_api_surface_test.py -q2 passed
  • static README/API compatibility check against tada/modules/tada.py → passed

Risk / compatibility

Low risk.

  • no runtime behavior changes
  • no model default changes
  • README examples now align more explicitly with the current API
  • the added test is AST-based, so it is fast and avoids model downloads

Files changed

  • README.md
  • tests/tada_api_surface_test.py

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify usage of InferenceOptions for advanced audio parameters in model.generate()

1 participant