Skip to content

feat: replace groq with cf-ai #133

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: replace groq with cf-ai #133

wants to merge 1 commit into from

Conversation

idosal
Copy link
Owner

@idosal idosal commented Apr 25, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 23:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the previous groq-based AI provider with a new workers-ai-provider implementation. Key changes include:

  • Removing the old getModel mechanism and replacing it with createWorkersAI using the CloudflareEnvironment's AI binding.
  • Modifying the model usage in the streamText function by passing the workersai model directly instead of using model.languageModel(selectedModel).
Files not reviewed (2)
  • package.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

app/routes/api.chat.ts:48

  • The new workersai function is used to obtain the model, which bypasses the previous call to languageModel(selectedModel). Please verify that the model object returned has the correct interface required by streamText.
const model = workersai("@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", {});

app/routes/api.chat.ts:70

  • Since the prior implementation invoked model.languageModel(selectedModel) to select the appropriate model, ensure that passing the model object directly meets the expected interface for streamText.
model: model,

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.

1 participant