Improve README for community engagement - #47
Merged
antonpibm merged 18 commits intoMay 20, 2026
Conversation
added 18 commits
May 19, 2026 22:45
Adds dynamic shields.io badges for corelib, raglib, and guardianlib showing monthly download counts pulled from the HuggingFace models API. Badges are placed in the top badge strip alongside License and Python version, use the HuggingFace logo, and follow the same flat/rounded style convention as the existing badges.
Parametric SVG generator (docs/generate_benchmark_svg.py) produces an animated visualization cycling through 18 slots across 3B/8B/30B model sizes. Each slot shows 4 adapters from corelib/raglib/guardianlib with real performance data extracted from the adapter catalog. LoRA/aLoRA type designations follow the catalog: prefer aLoRA when available, fall back to LoRA otherwise. Also fixes broken "Fast" link in README to point to the correct tutorial notebook path.
GitHub's SVG renderer doesn't support transform-box: fill-box, causing scaleX-based bar animations to scale from the viewport origin (x=0) instead of the element's left edge. Switch to animating the width property directly, which works universally. Also updates header to "CUSTOM GRANITE SWITCH MODEL".
- Rewrite opening to lead with action chain and aLoRA value prop - Add curated tutorials table with time estimates - Fix "high inference throughput" link to live race HTML - Update Browse Adapters link to interactive catalog - Rename "Models on HF" to "Pre-composed Models on HF" - Rephrase vLLM version note positively - Make Inference-ready bullet more concrete
Technical rewrite explains aLoRA routing mechanism: control tokens, KV cache isolation, and per-position routing. Removes Hello Adapter and aLoRA vs LoRA Race from tutorials table to focus on the three most actionable notebooks.
Remove HuggingFace example and swap query rewrite for a guardian social_bias check using Mellea — more compelling first impression of what the safety adapters can do.
Soft signals in the opening paragraph ("starting with the Granite
family") and How It Works ("technique is architecture-general;
Granite is the first supported family") without making commitments.
Links to the live race page. Shows aLoRA completing 20/32 queries while LoRA is still at 0/32 — visual proof of KV cache reuse.
fix table header, clarify ecosystem, add contributing section - Lead install with single pip command, collapse extras below - Bold "skip composition" callout for pre-composed models - Fix empty table header cell in tutorials - Reframe Granite Switch ecosystem bullet as "(this repo)" - Replace thin "IBM and Open Source AI" with Contributing section - Tighten license line
antonpibm
approved these changes
May 20, 2026
NoaTal1996
pushed a commit
that referenced
this pull request
May 20, 2026
* Add live HuggingFace download badges for granitelib libraries
Adds dynamic shields.io badges for corelib, raglib, and guardianlib
showing monthly download counts pulled from the HuggingFace models API.
Badges are placed in the top badge strip alongside License and Python
version, use the HuggingFace logo, and follow the same flat/rounded
style convention as the existing badges.
* Add animated benchmark SVG to README
Parametric SVG generator (docs/generate_benchmark_svg.py) produces an
animated visualization cycling through 18 slots across 3B/8B/30B model
sizes. Each slot shows 4 adapters from corelib/raglib/guardianlib with
real performance data extracted from the adapter catalog. LoRA/aLoRA
type designations follow the catalog: prefer aLoRA when available, fall
back to LoRA otherwise.
Also fixes broken "Fast" link in README to point to the correct tutorial
notebook path.
* Fix SVG rendering on GitHub: use width animation instead of scaleX
GitHub's SVG renderer doesn't support transform-box: fill-box, causing
scaleX-based bar animations to scale from the viewport origin (x=0)
instead of the element's left edge. Switch to animating the width
property directly, which works universally.
Also updates header to "CUSTOM GRANITE SWITCH MODEL".
* Improve README engagement: sharpen value prop, add tutorials table
- Rewrite opening to lead with action chain and aLoRA value prop
- Add curated tutorials table with time estimates
- Fix "high inference throughput" link to live race HTML
- Update Browse Adapters link to interactive catalog
- Rename "Models on HF" to "Pre-composed Models on HF"
- Rephrase vLLM version note positively
- Make Inference-ready bullet more concrete
* Strengthen opening paragraph: tie tagline to software analogy
* Add Ecosystem section: Granite Libraries, Mellea, and Granite Switch
* Rewrite How It Works section and trim tutorials table
Technical rewrite explains aLoRA routing mechanism: control tokens,
KV cache isolation, and per-position routing. Removes Hello Adapter
and aLoRA vs LoRA Race from tutorials table to focus on the three
most actionable notebooks.
* Replace Run Inference example with guardian safety check
Remove HuggingFace example and swap query rewrite for a guardian
social_bias check using Mellea — more compelling first impression
of what the safety adapters can do.
* Link tutorials directly to Colab and add badge column
* Hint that the architecture generalizes beyond Granite
Soft signals in the opening paragraph ("starting with the Granite
family") and How It Works ("technique is architecture-general;
Granite is the first supported family") without making commitments.
* Add aLoRA vs LoRA race screenshot below benchmark SVG
Links to the live race page. Shows aLoRA completing 20/32 queries
while LoRA is still at 0/32 — visual proof of KV cache reuse.
* Move race screenshot below Key Features section
* Add caption and Colab CTA below race screenshot
* Clarify race caption: different adapter technology
* Polish README: streamline install, promote pre-composed models,
fix table header, clarify ecosystem, add contributing section
- Lead install with single pip command, collapse extras below
- Bold "skip composition" callout for pre-composed models
- Fix empty table header cell in tutorials
- Reframe Granite Switch ecosystem bullet as "(this repo)"
- Replace thin "IBM and Open Source AI" with Contributing section
- Tighten license line
* Fix How It Works opener: clarify LoRA's KV cache limitation
* Improve accuracy of aLoRA description in How It Works
* Remove SVG generator script (kept in fork only)
---------
Co-authored-by: Luis A Lastras <lastrasl@us.ibm.com>
barvhaim
added a commit
that referenced
this pull request
Jul 27, 2026
…/x3) CI-runnable serving smoke closing the #47 e2e box. Boots a real composed, audio-enabled GraniteSwitch checkpoint under vLLM and drives text-only, adapter-control-token, and audio x1/x2/x3 requests through one live engine. Markers slow+requires_model+gpu (opt-in via -m); model built through the compose CLI with --enable-audio; synthetic audio keeps it asset-free. Verified green on an A100 with ibm-granite/granite-4.1-3b + granitelib-core-r1.0: 5 passed.
barvhaim
added a commit
that referenced
this pull request
Jul 27, 2026
…/x3) CI-runnable serving smoke closing the #47 e2e box. Boots a real composed, audio-enabled GraniteSwitch checkpoint under vLLM and drives text-only, adapter-control-token, and audio x1/x2/x3 requests through one live engine. Markers slow+requires_model+gpu (opt-in via -m); model built through the compose CLI with --enable-audio; synthetic audio keeps it asset-free. Verified green on an A100 with ibm-granite/granite-4.1-3b + granitelib-core-r1.0: 5 passed. Signed-off-by: BAR HAIM <barha@il.ibm.com>
barvhaim
added a commit
that referenced
this pull request
Jul 27, 2026
Adds the first correctness test for the "adapters + audio together" #47 box: the RAG answerability adapter judging a query against a document supplied as speech rather than text. The document is delivered as audio by placing a single <|audio|> marker as the document text (documents=[{"text": "<|audio|>"}]); the Granite template renders each document via `doc | tojson`, so the marker lands in the <documents> block exactly where vLLM's ASR processor splices the transcript — the document the adapter reasons over is the transcribed speech. The <|answerability|> control token is inserted by the same template (aLoRA fallback path), so the switch fires the adapter at the generation prompt. Ground truth comes from one real clip (hf-internal-testing/ librispeech_asr_dummy row 0), driving both classes without shipping a fixture: an answerable question whose answer is spoken, and an unanswerable one about content the clip never mentions. Both are distinctive enough to survive ASR word-errors, so the assertion tests the answerability decision, not transcription accuracy (WER is a separate box). FLAC is decoded with soundfile from the raw bytes to avoid requiring torchcodec (datasets>=4). Where test_audio_serving_smoke.py only proves an adapter control token doesn't crash the audio path, this proves the switch produces the correct verdict end-to-end through a live vLLM engine. Verified on an A100 with granite-4.1-3b + granitelib-rag-r1.0: 2 passed. Markers slow+requires_model+gpu; opt-in via pytest -m "slow and requires_model and gpu" Signed-off-by: BAR HAIM <barha@il.ibm.com>
barvhaim
added a commit
that referenced
this pull request
Jul 27, 2026
Adds the 'all default adapters route correctly with audio enabled' coverage for issue #47. Composes the full default set (RAG + Core + Guardian) with --enable-audio and asserts the switch maps each adapter_token_ids[i] to index i+1 (pre-control positions stay on base 0), observed via the HF backend's _last_adapter_indices. For granite-4.1-3b, 12 adapters resolve (context_relevance has no 4.1-3b flavor); verified 12/12 route correctly on A100. Loads with ignore_mismatched_sizes=True: the <|audio|> token bumps vocab_size one past the switch's control_to_substitute_lut buffer, which SingleSwitch rebuilds from config, so the freshly-built buffer is kept. Signed-off-by: BAR HAIM <barha@il.ibm.com>
barvhaim
added a commit
that referenced
this pull request
Jul 30, 2026
* tests: cover audio/adapter coexistence, chat-template marker, empty clips, clip ceiling Signed-off-by: BAR HAIM <barha@il.ibm.com> * tests: add e2e vLLM audio serving smoke (text + adapter + audio x1/x2/x3) CI-runnable serving smoke closing the #47 e2e box. Boots a real composed, audio-enabled GraniteSwitch checkpoint under vLLM and drives text-only, adapter-control-token, and audio x1/x2/x3 requests through one live engine. Markers slow+requires_model+gpu (opt-in via -m); model built through the compose CLI with --enable-audio; synthetic audio keeps it asset-free. Verified green on an A100 with ibm-granite/granite-4.1-3b + granitelib-core-r1.0: 5 passed. Signed-off-by: BAR HAIM <barha@il.ibm.com> * tests: e2e answerability adapter over an audio-delivered document (#47) Adds the first correctness test for the "adapters + audio together" #47 box: the RAG answerability adapter judging a query against a document supplied as speech rather than text. The document is delivered as audio by placing a single <|audio|> marker as the document text (documents=[{"text": "<|audio|>"}]); the Granite template renders each document via `doc | tojson`, so the marker lands in the <documents> block exactly where vLLM's ASR processor splices the transcript — the document the adapter reasons over is the transcribed speech. The <|answerability|> control token is inserted by the same template (aLoRA fallback path), so the switch fires the adapter at the generation prompt. Ground truth comes from one real clip (hf-internal-testing/ librispeech_asr_dummy row 0), driving both classes without shipping a fixture: an answerable question whose answer is spoken, and an unanswerable one about content the clip never mentions. Both are distinctive enough to survive ASR word-errors, so the assertion tests the answerability decision, not transcription accuracy (WER is a separate box). FLAC is decoded with soundfile from the raw bytes to avoid requiring torchcodec (datasets>=4). Where test_audio_serving_smoke.py only proves an adapter control token doesn't crash the audio path, this proves the switch produces the correct verdict end-to-end through a live vLLM engine. Verified on an A100 with granite-4.1-3b + granitelib-rag-r1.0: 2 passed. Markers slow+requires_model+gpu; opt-in via pytest -m "slow and requires_model and gpu" Signed-off-by: BAR HAIM <barha@il.ibm.com> * tests: use committed local speech clip for answerability-over-audio Replace the runtime hf-internal-testing/librispeech_asr_dummy download with a committed 3s 16 kHz WAV (SpeechT5, MIT-licensed) so the test runs offline and carries clean provenance for merge-to-main. The spoken sentence states a location that distil-whisper transcribes cleanly, so the questions key on the location rather than the proper noun. Verdicts verified: 2 passed on A100 (granite-4.1-3b + granitelib-rag-r1.0). Signed-off-by: BAR HAIM <barha@il.ibm.com> * tests: sweep all default adapters route correctly with audio enabled Adds the 'all default adapters route correctly with audio enabled' coverage for issue #47. Composes the full default set (RAG + Core + Guardian) with --enable-audio and asserts the switch maps each adapter_token_ids[i] to index i+1 (pre-control positions stay on base 0), observed via the HF backend's _last_adapter_indices. For granite-4.1-3b, 12 adapters resolve (context_relevance has no 4.1-3b flavor); verified 12/12 route correctly on A100. Loads with ignore_mismatched_sizes=True: the <|audio|> token bumps vocab_size one past the switch's control_to_substitute_lut buffer, which SingleSwitch rebuilds from config, so the freshly-built buffer is kept. Signed-off-by: BAR HAIM <barha@il.ibm.com> --------- Signed-off-by: BAR HAIM <barha@il.ibm.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
Test plan