Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smart-planes-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperbolic/ai-sdk-provider": patch
---

bump deps and tweak readme
6 changes: 3 additions & 3 deletions packages/ai-sdk-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hyperbolic Provider for Vercel AI SDK

The [Hyperbolic](https://hyperbolic.xyz/) provider for the [Vercel AI SDK](https://sdk.vercel.ai/docs) gives access to over 300 large language model on the OpenRouter chat and completion APIs.
The [Hyperbolic](https://hyperbolic.xyz/) provider for the [Vercel AI SDK](https://sdk.vercel.ai/docs) gives access to any model found at <https://app.hyperbolic.xyz/models>.

This is based on the [OpenRouter](https://openrouter.ai/) provider for the Vercel AI SDK, with a number of changes to support the Hyperbolic API and add image generation support.

Expand All @@ -19,7 +19,7 @@ yarn add @hyperbolic/ai-sdk-provider

## Provider Instance

You can import the default provider instance `openrouter` from `@openrouter/ai-sdk-provider`:
You can create a provider instance with `createHyperbolic` from `@hyperbolic/ai-sdk-provider`:

```ts
import { createHyperbolic } from "@hyperbolic/ai-sdk-provider";
Expand All @@ -33,7 +33,7 @@ import { generateText } from "ai";
import { createHyperbolic } from "@hyperbolic/ai-sdk-provider";

const hyperbolic = createHyperbolic({
apiKey: process.env.HYPERBOLIC_API_KEY,
apiKey: process.env.HYPERBOLIC_API_KEY, // Found in settings after logging in at https://app.hyperbolic.xyz
});

const { text } = await generateText({
Expand Down
7 changes: 3 additions & 4 deletions packages/ai-sdk-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@
"typescript": "catalog:"
},
"dependencies": {
"@ai-sdk/provider": "^1.0.10",
"@ai-sdk/provider-utils": "^2.1.12",
"@openrouter/ai-sdk-provider": "^0.4.3",
"ai": "4.1.58",
"@ai-sdk/provider": "^1.1.3",
"@ai-sdk/provider-utils": "^2.2.8",
"ai": "^4.3.16",
"zod": "^3.24.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export function convertToHyperbolicChatMessages(
case "redacted-reasoning":
break;
default: {
const _exhaustiveCheck: never = part;
throw new Error(`Unsupported part: ${_exhaustiveCheck}`);
throw new Error(`Unsupported part: ${part}`);
}
}
}
Expand Down Expand Up @@ -157,8 +156,7 @@ export function convertToHyperbolicChatMessages(
}

default: {
const _exhaustiveCheck: never = role;
throw new Error(`Unsupported role: ${_exhaustiveCheck}`);
throw new Error(`Unsupported role: ${role}`);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ export function convertToHyperbolicCompletionPrompt({
}

default: {
const _exhaustiveCheck: never = part;
throw new Error(`Unsupported content type: ${_exhaustiveCheck}`);
throw new Error(`Unsupported content type: ${part}`);
}
}
})
Expand All @@ -121,8 +120,7 @@ export function convertToHyperbolicCompletionPrompt({
}

default: {
const _exhaustiveCheck: never = role;
throw new Error(`Unsupported role: ${_exhaustiveCheck}`);
throw new Error(`Unsupported role: ${role}`);
}
}
}
Expand Down
139 changes: 39 additions & 100 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.