release: v0.4.0 - public API, CLI, config, and reward improvements#37
Merged
sacredvoid merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
- Expand public API: lazily expose reward helpers (math_verify_reward,
format_reward, extract_answer), eval helpers (compare_stages,
parse_results, BENCHMARK_PRESETS), and the Trainer protocol. dir(alignrl)
now reflects all lazy exports.
- Add BaseTrainConfig.to_yaml() for round-tripping configs and writing
them to disk.
- Validate BaseTrainConfig numeric fields (learning_rate, lora_r,
lora_dropout, batch sizes, etc.) and forbid unknown keys so YAML typos
fail fast.
- CLI: add 'alignrl version' subcommand and top-level -V/--version flag,
expose --num-fewshot and --batch-size on 'eval', and --temperature /
--max-tokens on 'serve' (forwarded to ModelServer via create_demo).
- Rewards: _normalize_numeric now handles thousands separators,
currency prefixes, and percent suffixes; extract_answer supports
'final answer:' variants, strips trailing punctuation, and unwraps
\text{...} inside \boxed{} groups; _answers_match is now case-
insensitive for string comparisons.
- Bump version to 0.4.0; add CHANGELOG.md. Test suite grows from 179 to
209 tests, all passing.
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.
format_reward, extract_answer), eval helpers (compare_stages,
parse_results, BENCHMARK_PRESETS), and the Trainer protocol. dir(alignrl)
now reflects all lazy exports.
them to disk.
lora_dropout, batch sizes, etc.) and forbid unknown keys so YAML typos
fail fast.
expose --num-fewshot and --batch-size on 'eval', and --temperature /
--max-tokens on 'serve' (forwarded to ModelServer via create_demo).
currency prefixes, and percent suffixes; extract_answer supports
'final answer:' variants, strips trailing punctuation, and unwraps
\text{...} inside \boxed{} groups; _answers_match is now case-
insensitive for string comparisons.
209 tests, all passing.