Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure Deepgram local development workflow with testing and mocks. Use when setting up development environment, configuring test fixtures, or establishing rapid iteration patterns for Deepgram integration. Trigger: "deepgram local dev", "deepgram development setup", "deepgram test environment", "deepgram dev workflow", "deepgram mock".
.claude/skills/jeremylongshore-deepgram-local-dev-loop/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 54% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 158% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 63% | 0% |
Set up a fast local development workflow for Deepgram: test fixtures with sample audio, mock responses for offline unit tests, Vitest integration tests against the real API, and a watch-mode transcription dev server.
@deepgram/sdk installed, DEEPGRAM_API_KEY configurednpm install -D vitest tsx dotenv for testing and dev servercurl for downloading test fixturesbashmkdir -p src tests/mocks fixtures touch src/transcribe.ts tests/transcribe.test.ts tests/mocks/deepgram-responses.ts
bash# Deepgram provides free sample audio files curl -o fixtures/nasa-podcast.wav \ https://static.deepgram.com/examples/nasa-podcast.wav curl -o fixtures/bueller.wav \ https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav
bash# .env.development DEEPGRAM_API_KEY=your-dev-key DEEPGRAM_MODEL=nova-3 # .env.test (use a separate test key with low limits) DEEPGRAM_API_KEY=your-test-key DEEPGRAM_MODEL=base
json{ "scripts": { "dev": "tsx watch src/transcribe.ts", "test": "vitest", "test:watch": "vitest --watch", "test:integration": "vitest run tests/integration/" } }
typescript// tests/mocks/deepgram-responses.ts export const mockPrerecordedResult = { metadata: { request_id: 'mock-request-id-001', created: '2026-01-01T00:00:00.000Z', duration: 12.5, channels: 1, models: ['nova-3'], model_info: { 'nova-3': { name: 'nova-3', version: '2026-01-01' } }, }, results: { channels: [{ alternatives: [{ transcript: 'Life moves pretty fast. If you don\'t stop and look around once in a while, you could miss it.', confidence: 0.98, words: [ { word: 'life', start: 0.08, end: 0.32, confidence: 0.99, punctuated_word: 'Life' }, { word: 'moves', start: 0.32, end: 0.56, confidence: 0.98, punctuated_word: 'moves' }, { word: 'pretty', start: 0.56, end: 0.88, confidence: 0.97, punctuated_word: 'pretty' }, { word: 'fast', start: 0.88, end: 1.12, confidence: 0.99, punctuated_word: 'fast.' }, ], }], }], utterances: [{ speaker: 0, transcript: 'Life moves pretty fast. If you don\'t stop and look around once in a while, you could miss it.', start: 0.08, end: 5.44, confidence: 0.98, }], }, }; export const mockLiveTranscript = { type: 'Results', channel_index: [0, 1], duration: 1.5, start: 0.0, is_final: true, speech_final: true, channel: { alternatives: [{ transcript: 'Hello, how are you today?', confidence: 0.95, words: [ { word: 'hello', start: 0.0, end: 0.3, confidence: 0.98, punctuated_word: 'Hello,' }, { word: 'how', start: 0.35, end: 0.5, confidence: 0.96, punctuated_word: 'how' }, ], }], }, }; export const mockTtsResponse = { content_type: 'audio/wav', request_id: 'mock-tts-001', model_name: 'aura-2-thalia-en', characters: { count: 42, limit: 100000 }, };
typescript// tests/transcribe.test.ts import { describe, it, expect, vi, beforeEach } from 'vitest'; import { mockPrerecordedResult } from './mocks/deepgram-responses'; // Mock the SDK vi.mock('@deepgram/sdk', () => ({ createClient: () => ({ listen: { prerecorded: { transcribeUrl: vi.fn().mockResolvedValue({ result: mockPrerecordedResult, error: null, }), transcribeFile: vi.fn().mockResolvedValue({ result: mockPrerecordedResult, error: null, }), }, }, speak: { request: vi.fn().mockResolvedValue({ getStream: () => Promise.resolve(null), }), }, }), })); describe('DeepgramTranscriber', () => { it('transcribes URL and returns transcript text', async () => { const { createClient } = await import('@deepgram/sdk'); const client = createClient('mock-key'); const { result } = await client.listen.prerecorded.transcribeUrl( { url: 'https://example.com/audio.wav' }, { model: 'nova-3', smart_format: true } ); expect(result.results.channels[0].alternatives[0].transcript).toContain('Life moves'); expect(result.metadata.duration).toBe(12.5); expect(result.metadata.request_id).toBe('mock-request-id-001'); }); it('returns word-level timing data', async () => { const { createClient } = await import('@deepgram/sdk'); const client = createClient('mock-key'); const { result } = await client.listen.prerecorded.transcribeUrl( { url: 'https://example.com/audio.wav' }, { model: 'nova-3' } ); const words = result.results.channels[0].alternatives[0].words; expect(words[0].word).toBe('life'); expect(words[0].start).toBe(0.08); expect(words[0].confidence).toBeGreaterThan(0.9); }); });
typescript// tests/integration/deepgram.test.ts import { describe, it, expect } from 'vitest'; import { createClient } from '@deepgram/sdk'; describe('Deepgram Integration', () => { const client = createClient(process.env.DEEPGRAM_API_KEY!); it('transcribes sample audio URL', async () => { const { result, error } = await client.listen.prerecorded.transcribeUrl( { url: 'https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav' }, { model: 'nova-3', smart_format: true } ); expect(error).toBeNull(); expect(result.results.channels[0].alternatives[0].transcript).toBeTruthy(); expect(result.results.channels[0].alternatives[0].confidence).toBeGreaterThan(0.8); }, 30000); it('verifies API key with project listing', async () => { const { result, error } = await client.manage.getProjects(); expect(error).toBeNull(); expect(result.projects.length).toBeGreaterThan(0); }); });
| Error | Cause | Solution | |-------|-------|----------| | Fixture 404 | Deepgram moved sample URL | Check latest URLs at developers.deepgram.com | | DEEPGRAM_API_KEY undefined in test | .env.test not loaded | Configure Vitest env or use dotenv/config | | Integration test timeout | Network or API slow | Increase timeout to 30000ms | | Mock shape mismatch | API response changed | Update mocks from real response capture |
Proceed to deepgram-sdk-patterns for production-ready code patterns.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 28,786 | 23,137 | -20% | 1 | 1 | 0% | 6,243 | 7,326 | +17% | 0 | 0 | — |
case-02 | fail→fail | 21,909 | 20,822 | -5% | 1 | 1 | 0% | 4,496 | 6,926 | +54% | 0 | 0 | — |
case-03 | fail→fail | 19,468 | 21,037 | +8% | 1 | 1 | 0% | 4,040 | 6,866 | +70% | 0 | 0 | — |
case-04 | pass→pass | 23,195 | 21,765 | -6% | 1 | 1 | 0% | 4,708 | 6,259 | +33% | 0 | 0 | — |
case-05 | pass→pass | 14,854 | 13,232 | -11% | 1 | 1 | 0% | 2,750 | 4,861 | +77% | 0 | 0 | — |
case-06 | pass→pass | 19,515 | 15,778 | -19% | 1 | 1 | 0% | 3,580 | 5,053 | +41% | 0 | 0 | — |
case-07 | fail→pass | 13,686 | 9,720 | -29% | 1 | 1 | 0% | 2,538 | 3,921 | +54% | 0 | 0 | — |
case-08 | fail→fail | 15,997 | 9,564 | -40% | 1 | 1 | 0% | 2,567 | 3,790 | +48% | 0 | 0 | — |
case-09 | fail→fail | 12,468 | 7,648 | -39% | 1 | 1 | 0% | 2,364 | 3,598 | +52% | 0 | 0 | — |
case-10 | fail→fail | 13,911 | 14,883 | +7% | 1 | 1 | 0% | 2,912 | 5,359 | +84% | 0 | 0 | — |
case-11 | pass→pass | 12,196 | 12,064 | -1% | 1 | 1 | 0% | 2,230 | 4,463 | +100% | 0 | 0 | — |
case-12 | fail→fail | 14,705 | 11,024 | -25% | 1 | 1 | 0% | 2,513 | 4,243 | +69% | 0 | 0 | — |
case-13 | pass→pass | 30,883 | 10,764 | -65% | 1 | 1 | 0% | 2,407 | 4,226 | +76% | 0 | 0 | — |
case-19 | fail→pass | 13,364 | 8,951 | -33% | 1 | 1 | 0% | 2,412 | 3,913 | +62% | 0 | 0 | — |
case-14 | fail→fail | 32,066 | 10,905 | -66% | 1 | 1 | 0% | 2,441 | 4,214 | +73% | 0 | 0 | — |
case-15 | fail→pass | 7,403 | 4,740 | -36% | 1 | 1 | 0% | 1,196 | 3,090 | +158% | 0 | 0 | — |
case-16 | fail→pass | 18,229 | 5,696 | -69% | 1 | 1 | 0% | 1,938 | 3,160 | +63% | 0 | 0 | — |
case-17 | pass→pass | 9,910 | 4,611 | -53% | 1 | 1 | 0% | 1,623 | 3,076 | +90% | 0 | 0 | — |
case-18 | pass→pass | 9,468 | 4,799 | -49% | 1 | 1 | 0% | 1,546 | 2,924 | +89% | 0 | 0 | — |
case-20 | pass→pass | 10,954 | 8,804 | -20% | 1 | 1 | 0% | 1,900 | 3,993 | +110% | 0 | 0 | — |
case-21 | pass→pass | 7,773 | 2,713 | -65% | 1 | 1 | 0% | 1,275 | 2,682 | +110% | 0 | 0 | — |
case-22 | pass→pass | 66,397 | 54,154 | -18% | 1 | 1 | 0% | 927 | 3,045 | +228% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.