Skip to content

Conversation

@Mrinank-Bhowmick
Copy link
Contributor

@Mrinank-Bhowmick Mrinank-Bhowmick commented Apr 29, 2025

Background

This PR adds support for Sarvam AI as a transcription provider in the Vercel AI SDK.

fixes - #6042

Summary

Took references from the ElevenLabs and Deepgram implementations of transcription.

Verification

import { createSarvam } from '@ai-sdk/sarvam';
import { experimental_transcribe as transcribe } from 'ai';
import { readFile } from 'fs/promises';

const sarvam = createSarvam({
  headers: {
    'api-subscription-key': '',
  },
});

const main = async () => {
  const result = await transcribe({
    model: sarvam.transcription('saarika:v2'),
    audio: await readFile('./src/transcript-test.mp3'),
    providerOptions: {
      sarvam: {
        language_code: 'en-IN',
      },
    },
  });

  console.log(result.text.toLowerCase());
};

main();

Output -

hello from the versal aisdk.

Tasks

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

Related Issues

#6042

@lgrammel
Copy link
Collaborator

Thank you - I'd prefer if you could host and publish it in your own github repo and npm package. Happy to add it as a community provider in our docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants