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 groq support #4765

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

Conversation

vishwamartur
Copy link

Related to #4763

Add groq API support with groq SDK.

  • Initialize groq instance: Import createGroq from groq SDK and add createGroqInstance, getGroqModel, and getGroqLlamaModel functions in app/lib/.server/llm/model.ts.
  • Stream text responses: Import getGroqModel in app/lib/.server/llm/stream-text.ts, update streamText function to use getGroqModel, and set headers for the groq instance.
  • Add constants: Add constants for maximum tokens and response segments limits for the groq model in app/lib/.server/llm/constants.ts.
  • Retrieve API key: Update getAPIKey function in app/lib/.server/llm/api-key.ts to retrieve the API key for the groq model.
  • Update routes: Import createGroq in app/routes/api.chat.ts and app/routes/api.enhancer.ts.

Related to stackblitz#4763

Add groq API support with groq SDK.

* **Initialize groq instance**: Import `createGroq` from `groq` SDK and add `createGroqInstance`, `getGroqModel`, and `getGroqLlamaModel` functions in `app/lib/.server/llm/model.ts`.
* **Stream text responses**: Import `getGroqModel` in `app/lib/.server/llm/stream-text.ts`, update `streamText` function to use `getGroqModel`, and set headers for the `groq` instance.
* **Add constants**: Add constants for maximum tokens and response segments limits for the `groq` model in `app/lib/.server/llm/constants.ts`.
* **Retrieve API key**: Update `getAPIKey` function in `app/lib/.server/llm/api-key.ts` to retrieve the API key for the `groq` model.
* **Update routes**: Import `createGroq` in `app/routes/api.chat.ts` and `app/routes/api.enhancer.ts`.
@vishwamartur vishwamartur marked this pull request as draft December 28, 2024 08:29
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