Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deepseek-ai/deepseek-r1 on Replicate #1151

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions packages/inference/src/providers/replicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export const REPLICATE_API_BASE_URL = "https://api.replicate.com";
type ReplicateId = string;

export const REPLICATE_SUPPORTED_MODEL_IDS: ProviderMapping<ReplicateId> = {
conversational: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose conversational here as the task type based on the existing Together AI code.

"deepseek-ai/DeepSeek-R1": "deepseek-ai/deepseek-r1",
},
"text-to-image": {
"black-forest-labs/FLUX.1-dev": "black-forest-labs/flux-dev",
"black-forest-labs/FLUX.1-schnell": "black-forest-labs/flux-schnell",
Expand Down
13 changes: 13 additions & 0 deletions packages/inference/test/HfInference.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,19 @@ describe.concurrent("HfInference", () => {
expect(res).toBeInstanceOf(Blob);
});

it("conversational unversioned", async () => {
Copy link
Contributor Author

@zeke zeke Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use some help getting this test right.

const res = await client.chatCompletion({
model: "deepseek-ai/DeepSeek-R1",
provider: "replicate",
messages: [{ role: "user", content: "Complete this sentence with words, one plus one is equal " }],
});
expect(res.choices).toBeDefined();
expect(res.choices?.length).toBeGreaterThan(0);
expect(res.choices?.[0].message?.content).toBeDefined();
const completion = res.choices[0].message?.content;
expect(completion).toContain("two");
});

it.skip("textToSpeech versioned", async () => {
const res = await client.textToSpeech({
model: "SWivid/F5-TTS",
Expand Down