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

Reduce Bundle Size #75

Open
1 of 7 tasks
RPate97 opened this issue Jul 14, 2024 · 1 comment
Open
1 of 7 tasks

Reduce Bundle Size #75

RPate97 opened this issue Jul 14, 2024 · 1 comment

Comments

@RPate97
Copy link
Contributor

RPate97 commented Jul 14, 2024

Problem

Since token.js currently integrates with every LLM provider using their javascript SDK, the package size is much larger than necessary. This can impact the performance of backend services using token.js in serverless functions.

Solution

Refactor LLM provider integrations to work directly with each providers API instead of using the SDK.

Comments

It's recommended to do this one at a time. The following providers still need to be refactored to remove their SDKs.

  • OpenAI
  • AWS Bedrock
  • Gemini
  • AI21
  • Anthropic
  • Cohere
  • Mistral

Note that the OpenAI SDK is also used to integrate Perplexity and Groq, so they will need to be refactored as well when removing that SDK.

@sam-goldman
Copy link
Contributor

AI21 doesn't have a JS library, so that integration doesn't use any dependencies aside from http and axios. I crossed it off the list.

@RPate97 RPate97 added good first issue Good for newcomers and removed good first issue Good for newcomers labels Jul 14, 2024
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
@RPate97 RPate97 reopened this Jan 16, 2025
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

No branches or pull requests

2 participants