jeremylongshore-tons-of-skills-marketplace-deepgram-migr-dc6413.ocm.json json Copy{
"ocm" : "1" ,
"id" : "jeremylongshore-tons-of-skills-marketplace-deepgram-migr-dc6413" ,
"kind" : "skill" ,
"name" : "deepgram-migration-deep-dive" ,
"description" : "Deep dive into migrating to Deepgram from other transcription providers. Use when migrating from AWS Transcribe, Google Cloud STT, Azure Speech, OpenAI Whisper, AssemblyAI, or Rev.ai to Deepgram. Trigger: \"deepgram migration\", \"switch to deepgram\", \"migrate transcription\", \"deepgram from AWS\", \"deepgram from Google\", \"replace whisper with deepgram\"." ,
"publisher" : "jeremylongshore" ,
"version" : "1.0.0" ,
"capabilities" : {
"domains" : [
"observability" ,
"customer_support"
],
"tags" : [
"skill-md" ,
"saas" ,
"deepgram" ,
"migration" ,
"transcription" ,
"skills-sh"
],
"languages" : [
"en"
]
},
"quality_prior" : 0.6 ,
"examples" : [
"Deep dive into migrating to Deepgram from other transcription providers. Use when migrating from AWS Transcribe, Google Cloud STT, Azure Speech, OpenAI Whisper, AssemblyAI, or Rev.ai to Deepgram. Trigger: \"deepgram migration\", \"switch to deepgram\", \"migrate transcription\", \"deepgram from AWS\", \"deepgram from Google\", \"replace whisper with deepgram\"."
],
"primary" : false ,
"metadata" : {
"source" : {
"provider" : "skills.sh" ,
"repository" : "https://github.com/jeremylongshore/tons-of-skills-marketplace" ,
"path" : "plugins/saas-packs/deepgram-pack/skills/deepgram-migration-deep-dive/SKILL.md" ,
"ref" : "HEAD" ,
"url" : "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/deepgram-pack/skills/deepgram-migration-deep-dive/SKILL.md" ,
"key" : "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/deepgram-pack/skills/deepgram-migration-deep-dive/SKILL.md"
},
"compatibility" : "Designed for Claude Code" ,
"allowed_tools" : [
"Read," ,
"Write," ,
"Edit," ,
"Bash(npm:*)," ,
"Bash(pip:*)"
],
"license" : "MIT"
},
"instructions" : "# Deepgram Migration Deep Dive\n\n## Prerequisites\n\n- An inventory of existing audio/transcript flows, data retention/consent obligations, evaluation fixtures, and rollback owner.\n- A staging environment with separate credentials and a compatibility/quality acceptance threshold.\n\n## Examples\n\nRun the old and new transcription flow against approved non-sensitive fixtures, compare aggregate accuracy/latency/error metrics, and route a small reversible staging canary only after acceptance passes. Roll back immediately on quality, consent, or operational regression; do not bulk-migrate or reprocess customer recordings before the observation window closes.\n\n## Current State\n\n!`npm list @deepgram/sdk 2>/dev/null | grep deepgram || echo 'Not installed'`\n!`npm list @aws-sdk/client-transcribe 2>/dev/null | grep transcribe || echo 'AWS Transcribe SDK not found'`\n!`pip show google-cloud-speech 2>/dev/null | grep Version || echo 'Google STT not found'`\n\n## Overview\n\nMigrate to Deepgram from AWS Transcribe, Google Cloud Speech-to-Text, Azure Cognitive Services, or OpenAI Whisper. Uses an adapter pattern with a unified interface, parallel running for quality validation, percentage-based traffic shifting, and automated rollback.\n\n## Feature Mapping\n\n### AWS Transcribe -> Deepgram\n\n| AWS Transcribe | Deepgram | Notes |\n|----------------|----------|-------|\n| `LanguageCode: 'en-US'` | `language: 'en'` | ISO 639-1 (2-letter) |\n| `ShowSpeakerLabels: true` | `diarize: true` | Same feature, different param |\n| `VocabularyName: 'custom'` | `keywords: ['term:1.5']` | Inline boosting, no pre-upload |\n| `ContentRedactionType: 'PII'` | `redact: ['pci', 'ssn']` | Granular PII categories |\n| `OutputBucketName` | `callback: 'https://...'` | Callback URL, not S3 |\n| Job polling model | Sync response or callback | No polling needed |\n\n### Google Cloud STT -> Deepgram\n\n| Google STT | Deepgram | Notes |\n|------------|----------|-------|\n| `RecognitionConfig.encoding` | Auto-detected | Deepgram auto-detects format |\n| `RecognitionConfig.sampleRateHertz` | `sample_rate` (live only) | REST auto-detects |\n| `RecognitionConfig.model: 'latest_long'` | `model: 'nova-3'` | Direct mapping |\n| `SpeakerDiarizationConfig` | `diarize: true` | Simpler configuration |\n| `StreamingRecognize` | `listen.live()` | WebSocket vs gRPC |\n\n### OpenAI Whisper -> Deepgram\n\n| Whisper | Deepgram | Notes |\n|---------|----------|-------|\n| Local GPU processing | API call | No GPU needed |\n| `whisper.transcribe(audio)` | `listen.prerecorded.transcribeFile()` | Similar interface |\n| `model='large-v3'` | `model: 'nova-3'` | 10-100x faster |\n| `language='en'` | `language: 'en'` | Same format |\n| No diarization | `diarize: true` | Deepgram advantage |\n| No streaming | `listen.live()` | Deepgram advantage |\n\n## Instructions\n\n### Step 1: Adapter Pattern\n\n```typescript\ninterface TranscriptionResult {\n transcript: string;\n confidence: number;\n words: Array<{ word: string; start: number; end: number; speaker?: number }>;\n duration: number;\n provider: string;\n}\n\ninterface TranscriptionAdapter {\n transcribeUrl(url: string, options: any): Promise<TranscriptionResult>;\n transcribeFile(path: string, options: any): Promise<TranscriptionResult>;\n name: string;\n}\n```\n\n### Step 2: Deepgram Adapter\n\n```typescript\nimport { createClient } from '@deepgram/sdk';\nimport { readFileSync } from 'fs';\n\nclass DeepgramAdapter implements TranscriptionAdapter {\n name = 'deepgram';\n private client: ReturnType<typeof createClient>;\n\n constructor(apiKey: string) {\n this.client = createClient(apiKey);\n }\n\n async transcribeUrl(url: string, options: any = {}): Promise<TranscriptionResult> {\n const { result, error } = await this.client.listen.prerecorded.transcribeUrl(\n { url },\n {\n model: options.model ?? 'nova-3',\n smart_format: true,\n diarize: options.diarize ?? false,\n language: options.language ?? 'en',\n keywords: options.keywords,\n redact: options.redact,\n }\n );\n if (error) throw new Error(`Deepgram: ${error.message}`);\n return this.normalize(result);\n }\n\n async transcribeFile(path: string, options: any = {}): Promise<TranscriptionResult> {\n const audio = readFileSync(path);\n const { result, error } = await this.client.listen.prerecorded.transcribeFile(\n audio,\n {\n model: options.model ?? 'nova-3',\n smart_format: true,\n diarize: options.diarize ?? false,\n }\n );\n if (error) throw new Error(`Deepgram: ${error.message}`);\n return this.normalize(result);\n }\n\n private normalize(result: any): TranscriptionResult {\n const alt = result.results.channels[0].alternatives[0];\n return {\n transcript: alt.transcript,\n confidence: alt.confidence,\n words: (alt.words ?? []).map((w: any) => ({\n word: w.punctuated_word ?? w.word,\n start: w.start,\n end: w.end,\n speaker: w.speaker,\n })),\n duration: result.metadata.duration,\n provider: 'deepgram',\n };\n }\n}\n```\n\n### Step 3: AWS Transcribe Adapter (Legacy)\n\n```typescript\n// Legacy adapter — wraps existing AWS Transcribe code for parallel running\nimport { TranscribeClient, StartTranscriptionJobCommand, GetTranscriptionJobCommand }\n from '@aws-sdk/client-transcribe';\n\nclass AWSTranscribeAdapter implements TranscriptionAdapter {\n name = 'aws-transcribe';\n private client: TranscribeClient;\n\n constructor() {\n this.client = new TranscribeClient({});\n }\n\n async transcribeUrl(url: string, options: any = {}): Promise<TranscriptionResult> {\n const jobName = `migration-${Date.now()}`;\n\n await this.client.send(new StartTranscriptionJobCommand({\n TranscriptionJobName: jobName,\n LanguageCode: options.language ?? 'en-US',\n Media: { MediaFileUri: url },\n Settings: {\n ShowSpeakerLabels: options.diarize ?? false,\n MaxSpeakerLabels: options.diarize ? 10 : undefined,\n },\n }));\n\n // Poll for completion (AWS is async-only)\n let job;\n do {\n await new Promise(r => setTimeout(r, 5000));\n const result = await this.client.send(new GetTranscriptionJobCommand({\n TranscriptionJobName: jobName,\n }));\n job = result.TranscriptionJob;\n } while (job?.TranscriptionJobStatus === 'IN_PROGRESS');\n\n if (job?.TranscriptionJobStatus !== 'COMPLETED') {\n throw new Error(`AWS Transcribe failed: ${job?.FailureReason}`);\n }\n\n // Fetch and normalize result\n const response = await fetch(job.Transcript!.TranscriptFileUri!);\n const data = await response.json();\n\n return {\n transcript: data.results.transcripts[0].transcript,\n confidence: 0, // AWS doesn't provide overall confidence\n words: data.results.items\n .filter((i: any) => i.type === 'pronunciation')\n .map((i: any) => ({\n word: i.alternatives[0].content,\n start: parseFloat(i.start_time),\n end: parseFloat(i.end_time),\n speaker: i.speaker_label ? parseInt(i.speaker_label.replace('spk_', '')) : undefined,\n })),\n duration: 0,\n provider: 'aws-transcribe',\n };\n }\n\n async transcribeFile(path: string): Promise<TranscriptionResult> {\n throw new Error('Upload to S3 first, then use transcribeUrl');\n }\n}\n```\n\n### Step 4: Migration Router with Traffic Shifting\n\n```typescript\nclass MigrationRouter {\n private adapters: Map<string, TranscriptionAdapter> = new Map();\n private deepgramPercent: number;\n\n constructor(deepgramPercent = 0) {\n this.deepgramPercent = deepgramPercent;\n }\n\n register(adapter: TranscriptionAdapter) {\n this.adapters.set(adapter.name, adapter);\n }\n\n setDeepgramPercent(percent: number) {\n this.deepgramPercent = Math.max(0, Math.min(100, percent));\n console.log(`Traffic split: ${this.deepgramPercent}% Deepgram, ${100 - this.deepgramPercent}% legacy`);\n }\n\n async transcribe(url: string, options: any = {}): Promise<TranscriptionResult> {\n const useDeepgram = Math.random() * 100 < this.deepgramPercent;\n const primary = useDeepgram ? 'deepgram' : this.getLegacyName();\n const adapter = this.adapters.get(primary);\n\n if (!adapter) throw new Error(`Adapter not found: ${primary}`);\n\n const start = Date.now();\n const result = await adapter.transcribeUrl(url, options);\n const elapsed = Date.now() - start;\n\n console.log(`[${primary}] ${elapsed}ms, confidence: ${result.confidence.toFixed(3)}`);\n return result;\n }\n\n private getLegacyName(): string {\n for (const [name] of this.adapters) {\n if (name !== 'deepgram') return name;\n }\n throw new Error('No legacy adapter registered');\n }\n}\n\n// Migration rollout:\nconst router = new MigrationRouter(0);\nrouter.register(new AWSTranscribeAdapter());\nrouter.register(new DeepgramAdapter(process.env.DEEPGRAM_API_KEY!));\n\n// Week 1: 5% to Deepgram\nrouter.setDeepgramPercent(5);\n// Week 2: 25%\nrouter.setDeepgramPercent(25);\n// Week 3: 50%\nrouter.setDeepgramPercent(50);\n// Week 4: 100% — migration complete\nrouter.setDeepgramPercent(100);\n```\n\n### Step 5: Parallel Running and Quality Validation\n\n```typescript\nasync function validateMigration(\n testAudioUrls: string[],\n legacyAdapter: TranscriptionAdapter,\n deepgramAdapter: TranscriptionAdapter,\n minSimilarity = 0.85\n) {\n console.log(`Validating ${testAudioUrls.length} files (min similarity: ${minSimilarity})`);\n\n const results: Array<{\n url: string;\n similarity: number;\n legacyConfidence: number;\n deepgramConfidence: number;\n legacyTime: number;\n deepgramTime: number;\n pass: boolean;\n }> = [];\n\n for (const url of testAudioUrls) {\n const legacyStart = Date.now();\n const legacy = await legacyAdapter.transcribeUrl(url);\n const legacyTime = Date.now() - legacyStart;\n\n const dgStart = Date.now();\n const dg = await deepgramAdapter.transcribeUrl(url);\n const dgTime = Date.now() - dgStart;\n\n // Jaccard similarity\n const words1 = new Set(legacy.transcript.toLowerCase().split(/\\s+/));\n const words2 = new Set(dg.transcript.toLowerCase().split(/\\s+/));\n const intersection = new Set([...words1].filter(w => words2.has(w)));\n const union = new Set([...words1, ...words2]);\n const similarity = intersection.size / union.size;\n\n results.push({\n url: url.substring(url.lastIndexOf('/') + 1),\n similarity,\n legacyConfidence: legacy.confidence,\n deepgramConfidence: dg.confidence,\n legacyTime,\n deepgramTime,\n pass: similarity >= minSimilarity,\n });\n }\n\n // Report\n const passCount = results.filter(r => r.pass).length;\n console.log(`\\n=== Validation Results ===`);\n for (const r of results) {\n console.log(`${r.pass ? 'PASS' : 'FAIL'} ${r.url}: similarity=${(r.similarity * 100).toFixed(1)}% ` +\n `(legacy: ${r.legacyTime}ms, deepgram: ${r.deepgramTime}ms)`);\n }\n console.log(`\\n${passCount}/${results.length} passed (${(passCount / results.length * 100).toFixed(0)}%)`);\n\n return { results, allPassed: passCount === results.length };\n}\n```\n\n### Step 6: Migration Checklist\n\n| Phase | Actions | Duration |\n|-------|---------|----------|\n| **Assessment** | Audit current usage, map features, estimate costs | 1 week |\n| **Setup** | Install SDK, implement adapter pattern, create test suite | 1 week |\n| **Validation** | Parallel run on test corpus, measure similarity | 1 week |\n| **Rollout 5%** | Enable for 5% of traffic, monitor closely | 1 week |\n| **Rollout 25%** | Increase if no issues, monitor error rate | 1 week |\n| **Rollout 50%** | Continue monitoring, compare costs | 1 week |\n| **Rollout 100%** | Full cutover, decommission legacy | 1 week |\n| **Cleanup** | Remove legacy adapter, update docs | 1 week |\n\n## Output\n\n- Unified TranscriptionAdapter interface\n- Deepgram and legacy (AWS/Google) adapter implementations\n- Migration router with percentage-based traffic shifting\n- Parallel running with Jaccard similarity validation\n- Migration timeline and checklist\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Low similarity | Feature mapping incomplete | Check options mapping (language, diarize) |\n| Deepgram slower than expected | First request cold start | Pre-warm with test request |\n| Missing features | No direct equivalent | Use `keywords` for custom vocab |\n| Rollback needed | Quality regression | `router.setDeepgramPercent(0)` immediately |\n\n## Resources\n\n- Deepgram Migration Guide\n- [Feature Comparison](https://deepgram.com/product/speech-to-text)\n- [Pricing Calculator](https://deepgram.com/pricing)\n- [Model Comparison](https://deepgram.com/learn/model-comparison-when-to-use-nova-2-vs-nova-3-for-devs)" ,
"cost" : {
"context_tokens" : 3159
}
}