Replace Cloudflare Worker with local Claude Agent SDK (zero API costs)#29
Open
ingokpp wants to merge 1 commit intofarzaa:mainfrom
Open
Replace Cloudflare Worker with local Claude Agent SDK (zero API costs)#29ingokpp wants to merge 1 commit intofarzaa:mainfrom
ingokpp wants to merge 1 commit intofarzaa:mainfrom
Conversation
Eliminate all external API costs by replacing the Cloudflare Worker proxy with local alternatives: - Claude API → local Node.js server using @anthropic-ai/claude-agent-sdk, which spawns the Claude Code CLI and inherits local session auth - ElevenLabs TTS → macOS NSSpeechSynthesizer (uses system voice including Siri voices, with AVSpeechSynthesizer fallback) - AssemblyAI STT → Apple Speech framework (already existed as fallback, now the default) The Cloudflare Worker is no longer needed — all three API routes are replaced with free, local alternatives that require no API keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
What this does
Replaces the Cloudflare Worker proxy with free, local alternatives — eliminating all external API costs:
@anthropic-ai/claude-agent-sdk, which spawns the Claude Code CLI and inherits local session auth (no API key needed)NSSpeechSynthesizerwithAVSpeechSynthesizerfallbackThe Cloudflare Worker (
worker/) is removed entirely.Why NSSpeechSynthesizer (deprecated) instead of AVSpeechSynthesizer?
Apple deprecated
NSSpeechSynthesizerin macOS 14 in favor ofAVSpeechSynthesizer. However,AVSpeechSynthesizercannot access Siri voices — only its own set of compact/enhanced/premium voices, which sound noticeably robotic.NSSpeechSynthesizeruses the system voice configured in Accessibility settings, which includes Siri voices and sounds dramatically better. It still works fine on macOS 14+ despite the deprecation. AnAVSpeechSynthesizerfallback is included in caseNSSpeechSynthesizerever stops working.How to run it
claude auth login)cd local-server && npm install && npm startDisclaimer
This was built almost entirely using Claude Code (Claude Opus 4.6). The implementation uses the Claude Agent SDK with local session auth, which works for personal use but is not intended for distributed applications per Anthropic's terms.
🤖 Generated with Claude Code