{"id":19815948,"url":"https://github.com/replicate/vercel-ai-provider","last_synced_at":"2026-02-06T08:02:55.929Z","repository":{"id":249681723,"uuid":"832228933","full_name":"replicate/vercel-ai-provider","owner":"replicate","description":"Reference implementation of the CustomProvider interface","archived":false,"fork":false,"pushed_at":"2024-07-22T15:24:19.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-18T10:59:52.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replicate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T15:22:31.000Z","updated_at":"2024-07-22T15:24:22.000Z","dependencies_parsed_at":"2024-07-22T18:57:31.209Z","dependency_job_id":null,"html_url":"https://github.com/replicate/vercel-ai-provider","commit_stats":null,"previous_names":["replicate/vercel-ai-provider"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/replicate/vercel-ai-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fvercel-ai-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fvercel-ai-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fvercel-ai-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fvercel-ai-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/vercel-ai-provider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fvercel-ai-provider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267329308,"owners_count":24069835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:07:49.677Z","updated_at":"2026-02-06T08:02:55.886Z","avatar_url":"https://github.com/replicate.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Reference Implementation of Vercel AI SDK Custom Provider\n=========================================================\n\nSee: https://sdk.vercel.ai/providers/community-providers/custom-providers\n\nBasic usage picks up `REPLICATE_API_TOKEN` from the local environment.\n\n```js\nimport replicate, { createReplicateProvider } from \"./main\";\nimport { streamText } from \"ai\";\n\nconst model = replicate.llm(\"meta/meta-llama-3-70b-instruct\");\nconst { textStream } = await streamText({\n  model,\n  prompt: \"Write a vegetarian lasagna recipe for 4 people.\"\n});\n\nfor await (const textPart of textStream) {\n  process.stdout.write(textPart);\n}\n```\n\nCustom provider can be created with:\n\n```js\nconst replicate = createReplicateProvider({\n  apiKey: 'r8_xyz',\n});\n```\n\nAdditional inputs can be provided to the model:\n\n```js\nconst model = replicate.llm(\"meta/meta-llama-3-70b-instruct\", {\n  extraInput: {\n    top_p: 0.8,\n    max_tokens: 1024,\n  } \n});\n```\n\nPrompt and system prompt input names can be customized as well as the transformers:\n\n```js\nconst model = replicate.llm(\"meta/meta-llama-3-70b-instruct\", {\n  promptName: \"my_prompt\",\n  promptTransformer: (p) =\u003e p.map(message =\u003e {\n    if (message.role === \"user\") {\n       return `[INST]${message.content.map(c =\u003e c.text).join('')}[\\INST]`;\n    }\n    ...\n  }).join(\"\"),\n  systemPromptName: \"my_system_prompt\",\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fvercel-ai-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Fvercel-ai-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fvercel-ai-provider/lists"}