Gemma 4 model integration, language TTS, auto config wrangler URL#28
Open
MathisZerbib wants to merge 20 commits intofarzaa:mainfrom
Open
Gemma 4 model integration, language TTS, auto config wrangler URL#28MathisZerbib wants to merge 20 commits intofarzaa:mainfrom
MathisZerbib wants to merge 20 commits intofarzaa:mainfrom
Conversation
- Upgraded wrangler from version 3.0.0 to 4.81.0 in package.json. - Changed ANTHROPIC_API_KEY to LM_STUDIO_API_KEY in index.ts to reflect new API usage. - Updated ELEVENLABS_VOICE_ID and added ASSEMBLYAI_API_KEY and LM_STUDIO_API_KEY in wrangler.toml.
MathisZerbib
commented
Apr 8, 2026
worker/wrangler.toml
Outdated
…er to support local development
…oved visibility handling
…ynamic URL detection
… language selection + add second panel for configuration model and language
Author
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
OpenAIAPI.swiftclient pointing to127.0.0.1:1234. If a selected model name doesn't contain "claude", the app routes Vision and Chat requests locally entirely free of charge. Fetches available local models dynamically.WorkerEnvironment, which performs a fast 0.5s pre-flight check tolocalhost:8787on startup. If a local Cloudflare worker is running, it auto-connects to it; otherwise, it seamlessly falls back to the production worker URL.UserDefaults.🗂️ Files Changed
CompanionManager.swift: Added@Publishedsettings forselectedLanguageCode,lmStudioAPIKey, andavailableModels. AddedfetchAvailableModels()to pull models from LM Studio on init. UpdatedanalyzeImageStreaming()pipelines to route appropriately to either Claude or the OpenAI SDK depending on the model, injecting the target language code into the prompt.CompanionPanelView.swift: Introduced an animated gear icon resolving to a newsettingsView. Features a secure API key field with a visibility toggle, the new language picker, and the model picker rows smoothly tucked away.WorkerEnvironment.swift: New actor dedicated to sniffing out thehttp://localhost:8787worker connection and failing over to the production URL.ElevenLabsTTSClient.swift&OpenAIAPI.swift: Refactored to accept mutable base URLs. ImplementedanalyzeImageStreamingwithin the OpenAI client using SSE to conform to the same progressive data streaming expectations as the Claude API.✅ Test Plan
1234. Enter a local API key (if applicable), pick the Gemma model from the dropdown, and fire a vision query. Ensure responses stream back properly using the local backend.npx wrangler devin the worker folder, launch the app, and verify it prints🌐 Auto-detected local worker. Kill the worker, relaunch the app, and verify it falls back to parsing the prod route.selectedLanguageCode,lmStudioAPIKey, andselectedGemmaModelstate values survive termination gracefully viaUserDefaults.