Add Cerebras fast rewording provider#173
Open
MyButtermilk wants to merge 1 commit into
Open
Conversation
MyButtermilk
marked this pull request as ready for review
July 9, 2026 08:02
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
This PR implements the practical path suggested by MyButtermilk in #171: add a very fast built-in provider option for post-dictation cleanup/rewording instead of immediately expanding every prompt with its own provider/model routing.
Changes:
Cerebrasas a built-in chat-only provider preset.gemma-4-31b.gemma-4-31b,gpt-oss-120b, andzai-glm-4.7.CHAT_ONLY.https://api.cerebras.ai/v1/.Refs #171.
Why this is valuable
Issue #171 discusses per-prompt provider/model selection for rewording prompts. MyButtermilk's comment points out that the largest immediate UX win may not require full per-prompt routing: common post-dictation cleanup tasks are short, repetitive, and latency-sensitive. Punctuation cleanup, filler-word removal, and light grammar correction benefit most from a provider/model path that starts quickly and returns quickly.
Cerebras is a good fit for that narrow path because its inference API is OpenAI-compatible, so Dictate can reuse the existing provider infrastructure instead of adding new request plumbing. That keeps this change small while still giving users a fast rewording target. The selected default,
gemma-4-31b, follows the model suggested in the issue discussion and is listed in Cerebras' model catalog.This improves the app in a few concrete ways:
Intentional scope
This PR intentionally does not implement full per-prompt provider/model selection. It also does not add provider-specific temperature, max-token, or streaming controls yet. Cerebras supports streaming, but Dictate's current provider preset model is focused on provider capabilities and model defaults, so adding streaming/parameter policy would be a separate UI/configuration change.
Keeping this PR focused makes it easier to review and gives users the main performance-oriented option requested in the issue discussion without expanding the data model.
Validation
Ran:
./gradlew.bat :app:testDebugUnitTest --tests "dev.patrickgold.florisboard.dictate.ProviderRegistryTest" :app:compileDebugKotlin :lib:dictate-core:compileDebugKotlin :wear:compileDebugKotlinResult: build successful, including
ProviderRegistryTest > cerebrasIsAvailableAsFastRewordingProvider().Also ran
git diff --checksuccessfully.References