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

Conversation

zeke
Copy link
Contributor

@zeke zeke commented Jan 29, 2025

@@ -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.

@@ -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.

@Wauplin
Copy link
Contributor

Wauplin commented Jan 29, 2025

Hi @zeke, it seems like Replicate does not support the chat completion API (or at least it's not documented on https://replicate.com/deepseek-ai/deepseek-r1/api/schema). By "chat completion" I mean the standard API introduced by OpenAI and now supported by many providers: https://platform.openai.com/docs/api-reference/chat/create. The main difference between this API and a classic "text-generation" API is that the user can pass a list of messages instead of a pre-formatted prompt. Users don't need to play with the chat template client side.

So in order to have support for DeepSeek R1 on Replicate via HF, you should either set it as a "text-generation" task (but that wouldn't make it appear in the Widget on https://huggingface.co/deepseek-ai/DeepSeek-R1) or support the Chat Completion API on Replicate.

(Note: "Message API", "Conversational", "Chat completion" all refer to the same API schema)

@zeke
Copy link
Contributor Author

zeke commented Jan 29, 2025

Thanks for the context @Wauplin, that's very helpful. Let me take this back to the team and see what we can do.

@julien-c
Copy link
Member

if it's public info, what are you running backend-wise to power R1 inference? might have an OpenAI compatible server

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.

3 participants