llm.js icon indicating copy to clipboard operation
llm.js copied to clipboard

Add documentation on how to use directly in the browser

Open tomzx opened this issue 4 months ago • 2 comments

Hello!

Great library!

It would be great if you could add documentation on how to use LLM.js directly in the browser, and if possible, provide a CDN-backed url, maybe using something like https://cdn.jsdelivr.net/?

I was able to get this working by importing https://cdn.jsdelivr.net/npm/@themaximalist/[email protected]/dist/index.mjs but maybe this could be done more cleanly?

Thanks!

tomzx avatar Aug 11 '25 01:08 tomzx

Thanks I'll get this added!

themaximalist avatar Aug 12 '25 04:08 themaximalist

I made a few changes in my fork, specifically I ended up enabling IIFE (Immediately Invoked Function Expression) as a build format and disabled minifying since jsdelivr.net will minify for you a if you include "min" in the url (e.g., dist/index.min.js when dist/index.js exists).

tomzx avatar Nov 28 '25 05:11 tomzx