Skip to content

feat(ai): ungate Gemma 3 4B and offer Q4_K_M / Q8_0 / f16 quants - #81

Merged
scotej merged 1 commit into
mainfrom
fix/gemma-ungated-quants
Jul 25, 2026
Merged

feat(ai): ungate Gemma 3 4B and offer Q4_K_M / Q8_0 / f16 quants#81
scotej merged 1 commit into
mainfrom
fix/gemma-ungated-quants

Conversation

@scotej

@scotej scotej commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • ggml-org/gemma-3-4b-it-GGUF is not gated (HF API gated: false, verified 2026-07-25) — drop the token requirement from the Best tier and update the stale keychain-help copy.
  • Register the repo's other two quants (Q8_0, f16) as separate ModelSpec entries at the same pinned revision, sharing the f16 projector manifest. Each keeps its own install dir + benchmark record; existing gemma3-4b (Q4_K_M) installs keep their id and stay valid.
  • New quantFamily grouping collapses the three into one picker card with a Quantization radio selector (busy variant pins the card; installed variants marked in the option label).
  • ARCHITECTURE.md §8 table updated alongside the manifest (models.ts header rule). Retired the obsolete GatedNeedsToken story in favor of QuantVariantInstalled.

Manifest verification

Sizes + SHA256s taken from the HF API tree at pinned revision d09762... (LFS oids):

  • gemma-3-4b-it-Q8_0.gguf 4 130 226 336 B
  • gemma-3-4b-it-f16.gguf 7 767 474 336 B

Testing

  • npm run build, lint, test (778 passed), check-tokens, check-strings, check-contrast all green.
  • New unit tests: registry shape (6 specs / 4 tiers), no-gated invariant, Gemma family shares repo+revision+mmproj with distinct weight SHAs, modelCardGroups grouping.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added selectable quantization variants for supported vision models, with download sizes and installed status shown in the model picker.
    • Grouped related model variants into a single card while preserving individual installation options.
    • Added additional Gemma 3 4B quantization options, including Q8 and F16.
  • Documentation
    • Updated model guidance, download estimates, latency information, and Hugging Face token requirements.
    • Clarified model and projector pairing recommendations.

The ggml-org/gemma-3-4b-it-GGUF mirror is not gated (HF API gated:false,
verified 2026-07-25), so the Best tier no longer demands a Hugging Face
token. The repo also ships Q8_0 and f16 weights at the same pinned
revision sharing one f16 projector; register them as separate specs
(own install dir + benchmark record each) and collapse the three into a
single picker card behind a Quantization radio selector. Existing
gemma3-4b (Q4_K_M) installs keep their id and stay valid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 12:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c9a9db0a-7c9a-49bb-afbc-dd679c27ed88

📥 Commits

Reviewing files that changed from the base of the PR and between eb74005 and 12265ab.

📒 Files selected for processing (7)
  • ARCHITECTURE.md
  • src/features/ai/ModelPicker.tsx
  • src/features/ai/index.ts
  • src/features/ai/models.ts
  • src/stories/ModelPicker.stories.tsx
  • src/strings.ts
  • tests/unit/ai-models.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Rust (Windows)
  • GitHub Check: Frontend
🧰 Additional context used
📓 Path-based instructions (9)
src/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{ts,tsx,css}: Use design tokens instead of hard-coded visual values in frontend TypeScript, TSX, and CSS files.
Meet WCAG AA requirements for every text/background pairing in both themes; do not convey information by color alone.
Respect reduced-motion preferences through the global kill switch; new motion sites must be gated by default.

Files:

  • src/features/ai/index.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{ts,tsx}: Keep JSX text and aria-label literals consistent with the voice defined in DESIGN-SYSTEM.md §14, and prefer centralized strings.
Treat peer wire formats and identity derivation as cross-version contracts; coordinate changes so older peers and existing stored data remain compatible.
Do not add telemetry; the application must remain local-only.

Files:

  • src/features/ai/index.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
src/**/*.{ts,tsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

Never instruct users to paste a model file or BIP39 mnemonic into an AI service or chat.

Files:

  • src/features/ai/index.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
**/*.{ts,tsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,rs}: Add comments only when the reason is non-obvious; identifiers should carry meaning and code should read top-to-bottom.
Maintain scope discipline: do not refactor adjacent code during feature work or add abstractions for hypothetical future needs.

Files:

  • src/features/ai/index.ts
  • tests/unit/ai-models.test.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use TypeScript strict mode and ensure frontend code passes the TypeScript build and type checks.

Files:

  • src/features/ai/index.ts
  • tests/unit/ai-models.test.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

**/*: Before committing or opening a PR, run the required build, lint, test, design-token, strings, contrast, accessibility, formatting, and relevant Rust quality gates.
Use one focused change per commit with a Conventional Commit subject such as feat:, fix:, chore:, docs:, or ci:; PRs should squash-merge.

Files:

  • src/features/ai/index.ts
  • ARCHITECTURE.md
  • tests/unit/ai-models.test.ts
  • src/strings.ts
  • src/stories/ModelPicker.stories.tsx
  • src/features/ai/models.ts
  • src/features/ai/ModelPicker.tsx
**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Write Vitest tests for applicable unit and integration behavior; component tests are not currently supported without an explicit test-harness scope expansion.

Files:

  • tests/unit/ai-models.test.ts
src/strings.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Keep toast and notification copy in src/strings.ts; prefer this module for user-facing strings.

Files:

  • src/strings.ts
src/**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.stories.{ts,tsx}: Provide Storybook coverage for every primitive and feature component.
Ensure every Storybook story passes the axe-core accessibility gate.

Files:

  • src/stories/ModelPicker.stories.tsx
🔇 Additional comments (7)
src/features/ai/models.ts (1)

49-53: LGTM!

Also applies to: 125-204, 238-270

src/features/ai/index.ts (1)

12-14: LGTM!

tests/unit/ai-models.test.ts (1)

10-10: LGTM!

Also applies to: 47-93

ARCHITECTURE.md (1)

448-451: LGTM!

src/features/ai/ModelPicker.tsx (1)

2-5: LGTM!

Also applies to: 28-35, 201-217, 231-259, 328-362

src/strings.ts (1)

1151-1151: LGTM!

Also applies to: 1466-1472

src/stories/ModelPicker.stories.tsx (1)

215-229: LGTM!


📝 Walkthrough

Walkthrough

Gemma 3 4B now has multiple registered quant variants sharing a projector, grouped into one model card with quant selection. Picker copy, Storybook coverage, architecture documentation, exports, and registry tests were updated accordingly.

Changes

Vision model quantization

Layer / File(s) Summary
Model registry and quant-family grouping
src/features/ai/models.ts, src/features/ai/index.ts, tests/unit/ai-models.test.ts, ARCHITECTURE.md
ModelSpec supports quantFamily; Gemma variants share projector metadata while retaining distinct model files, and modelCardGroups groups variants into picker entries. Registry expectations and architecture notes were updated.
Quantized model card selection
src/features/ai/ModelPicker.tsx, src/strings.ts, src/stories/ModelPicker.stories.tsx
Model cards render grouped variants, select the active quant based on busy/chosen/installed state, and display quant labels, sizes, and installed status. Copy and Storybook coverage were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ModelPicker
  participant modelCardGroups
  participant ModelCard
  participant PickerState
  ModelPicker->>modelCardGroups: group SUPPORTED_MODELS by quantFamily
  modelCardGroups-->>ModelPicker: return variant groups
  ModelPicker->>ModelCard: pass per-variant PickerState entries
  ModelCard->>PickerState: select busy, chosen, installed, or first variant
  ModelCard-->>ModelPicker: render selected quantization actions
Loading

Suggested reviewers: copilot, claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: ungating Gemma 3 4B and adding multiple quant variants.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/gemma-ungated-quants

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scotej
scotej merged commit 39a403b into main Jul 25, 2026
4 checks passed
@scotej
scotej deleted the fix/gemma-ungated-quants branch July 25, 2026 12:47
scotej added a commit that referenced this pull request Jul 25, 2026
Textually clean merge; overlapping files (lib.rs, index.css, strings.ts,
ARCHITECTURE.md, DESIGN-SYSTEM.md) touched disjoint hunks.
scotej added a commit that referenced this pull request Jul 25, 2026
Retitle the staged Unreleased section to 1.7.0 and fold in the
user-facing story of PRs #81#85 (Gemma ungated + three quants, the
add-friend two-column layout + cardstock texture, friendly DB errors,
settings spacing) that the wave-3 staging predated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants