Open louis030195 opened 6 months ago
You could implement a custom provider (see https://sdk.vercel.ai/providers/community-providers/custom-providers ) that directly calls web llm. The llamacpp community provider does something similar (in process communication) I think.
@lgrammel i thought about this but isn't provider called on server side?
basically wants to leverage the hooks like useChat
, generative UI stuff etc. but with client side LLM
AI SDK core could also be used on the client side. That said, you are right, useChat
etc require a server connection. What you could do is use e.g. AI SDK Core streamObject
or streamText
client side and then operate directly on those results (without useChat
et al).
Is this sdk going to have better support for client side LLMs? Clients have more and more powerful AI accelerators, future apps will use both client and server side LLMs
Got it working but too much effort to make it work with all the generative UIs features atm which assume a lot of server side stuff. Depending update of this issue will implement my own lib for client side generative UI
I don't understand what you mean by client-side support. Most parts of the AI SDK work on the client, and you can e.g. use Chrome AI in the browser: https://sdk.vercel.ai/providers/community-providers/chrome-ai
I don't understand what you mean by client-side support. Most parts of the AI SDK work on the client, and you can e.g. use Chrome AI in the browser: https://sdk.vercel.ai/providers/community-providers/chrome-ai
thanks!
assuming this won't work with rsc
?
RSCs require a server. If you are already on a client, they are not needed
Feature Description
Compatibility with
https://github.com/mlc-ai/web-llm
Use Case
Running LLM in the browser, no need a server
Additional context
I've been using
ai
withmlc-llm
(core lib poweringweb-llm
) by running as a server by implementing a provider (very similar to the Mistral one) but I want to just run the LLM in the browser so there is less infra, and it can still leverage client's GPUAnyone tried to use
ai
withweb-llm
?