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

Vercel AI SDK examples #242

Open
techpeace opened this issue Aug 2, 2024 · 2 comments
Open

Vercel AI SDK examples #242

techpeace opened this issue Aug 2, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@techpeace
Copy link
Sponsor

techpeace commented Aug 2, 2024

I made a start at adding some Vercel AI SDK examples for Express: https://github.com/OvidijusParsiunas/deep-chat/compare/main...techpeace:vercel-ai-sdk?expand=1

Vercel AI SDK is a nice addition since it abstracts calls to several LLM providers.

Anything else I should add? Off the top of my head, I guess we could also use:

  • Next example
  • Svelte example
  • nestjs example
image
@OvidijusParsiunas
Copy link
Owner

Hi @techpeace.
I really appreciate you going out of the way to provide code examples on other tools.
There are a couple of small notes to consider in the code:

  • Is there perhaps a way to hit the Vercel SDK via raw JavaScript code instead of an NPM package? The reason for asking this is because I am trying to keep the example servers as lightweight as possible so when devs try them out on their local computers they would need to install a minimal amount of dependencies to get things to work (and at the same time they would need to care less about what dependencies are optional). More dependencies is something that unfortunately does not scale well when adding more AI examples in the future.
  • The React UI example that you have edited is meant to work with all example servers (excluding the SSR ones), hence all other frameworks will need to be able to use this code too.

Deep Chat has been adapted by a huge variety of community/commercial projects and I have been thinking about creating a special section in the repo to showcase them. Hence, to minimize the work needed of tailoring your solution to the above requirements, it would probably be best to have your example there. Please let me know if this works for you.

Thanks!

@OvidijusParsiunas OvidijusParsiunas self-assigned this Aug 2, 2024
@OvidijusParsiunas OvidijusParsiunas added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 2, 2024
@techpeace
Copy link
Sponsor Author

Is there perhaps a way to hit the Vercel SDK via raw JavaScript code instead of an NPM package?

The Vercel AI SDK is an NPM package, so I'm not familiar with any way of using it beyond including it as a dependency or copying in the full code of the package, which wouldn't fit with the goal of keeping the example server "lightweight." It has no servers of its own to make direct requests to–it's an abstraction over other LLM provider API's.

It's likely a worthwhile example, because many folks building new JS backends are likely going to be using the AI SDK, as it's quickly emerging as a popular choice. If not, they'll potentially be using one of the providers' official Node client libraries rather than making direct API calls.

I do think it would be useful to have examples that align to real-world usage patterns (and thus include dependencies from the relevant ecosystems), so I'd be happy to house this code elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants