Repository navigation
✨ feat: generate snippet titles with Gemma 4 26B-A4B - #38
Merged
Merged
Conversation
Benchmarked on 16 varied snippets against llama-3.2-3b-instruct: Gemma names noticeably better (UserCard vs UserCardComponent, EventEmitter vs emit-event, retryWithBackoff vs retryFunction, github-actions-ci vs ci-deploy, eslint-config vs next-config). Cost is negligible either way (~$0.00004 vs ~$0.00002 per title, ~430 input / ~5 output tokens). Latency is typically 400-700ms vs ~250ms. Gemma reasons by default and burns the whole 24-token budget thinking, so thinking is disabled. It also returns an OpenAI-style `choices` payload instead of `response`, so the route now reads both shapes.
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
klipcode | 40853d2 | Commit Preview URL Branch Preview URL |
Oct 20 2026, 10:37 AM |
There was a problem hiding this comment.
Review
Switches snippet-title generation from the Llama 3.2 3B model to Gemma 4 26B-A4B, disables Gemma's default thinking budget, and adds a normalizer that accepts either the legacy { response } or OpenAI-style { choices[0].message.content } Workers AI payload before passing the text to the existing sanitizer. No other routes or callers change.
Risk: low
Automated review — opencode-go/deepseek-v4.1-flash · 0 comment(s)
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
Switch AI title generation from
@cf/meta/llama-3.2-3b-instructto@cf/google/gemma-4-26b-a4b-it.Benchmark (16 snippets, same prompt, same sampling)
UserCardcomponentEventEmitterclassThe rest were equivalent (useDebounce, fetch_user_data, define-port, red-background, deploy-checklist, square_even_numbers).
Cost / latency
Notes
max_tokensthinking (empty output) →chat_template_kwargs.enable_thinking: false.choices[0].message.contentpayload (confirmed through the realenv.AIbinding), so the route reads that and falls back toresponse.Test plan
tsc,eslint,vitestpass