-
Notifications
You must be signed in to change notification settings - Fork 11k
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
server : (webui) revamp Settings dialog, add Pyodide interpreter #11759
Conversation
How did you get it to generate the "Mortgage Calculator" title? Qwen Coder does not seem to do it. |
I'm using llama 3.1 8B, but it's quite random, it never does that again when I regenerate the message |
Yeah right, it's also blocking main thread so the UX is not very good. But unfortunately it's quite complicated to fix, because this requires implementing a web worker: https://pyodide.org/en/stable/usage/webworker.html I'll see if I can fix in this PR, but otherwise I think we can still release the first version without it, to be added later on. |
Is there a way we can have llama-server serve these dependencies so the internet connection is not required? Like, some folder we can dump them into. Maybe a future issue but would prefer to serve these directly |
We can and it's trivial to do. But I'm not comfortable of shipping a binary containing 8MB of |
Both points sound valid - local servers should be fully usable without connecting to the Internet, but keeping the core as small as possible is important, too. If it's a simple thing, then maybe you could just add some brief instructions how to run it this way? |
@MoonRide303 it's trivial to implement doen't mean end-user can easily do that. What I mean by trivial is that we as developer can download the vendor library to /public directory and compile llama-server with it. A better way would be to do this completely on the web level and not at cpp level. We can download the vendor library (in this case, pyodide wasm file) into browser's cache and store it there. User only need to download once, then next time we load from browser's cache. Would appreciate if someone can play with this. |
I agree with @MoonRide303 and that was my original intention. For the average user they can download it from the pyodide website, store it in their browser's cache, whatever. For power users that want 100% control over the longevity/accessibility/privacy of their service and want to self host their llama.cpp with no outside dependencies (after setup) that can run forever, we should have some "somewhat easy" way for them to do that without having to modify code themselves. For example, maybe we can hint which URL to load pyodide from in some server endpoint, where an absent value means just use the default, but if the user wants to locally serve pyodide they can change it. |
…l-org#11759) * redo Settings modal UI * add python code interpreter * fix auto scroll * build * fix overflow for long output lines * bring back sticky copy button * adapt layout on mobile view * fix multiple lines output and color scheme * handle python exception * better state management * add webworker * add headers * format code * speed up by loading pyodide on page load * (small tweak) add small animation to make it feels like claude
…l-org#11759) * redo Settings modal UI * add python code interpreter * fix auto scroll * build * fix overflow for long output lines * bring back sticky copy button * adapt layout on mobile view * fix multiple lines output and color scheme * handle python exception * better state management * add webworker * add headers * format code * speed up by loading pyodide on page load * (small tweak) add small animation to make it feels like claude
…l-org#11759) * redo Settings modal UI * add python code interpreter * fix auto scroll * build * fix overflow for long output lines * bring back sticky copy button * adapt layout on mobile view * fix multiple lines output and color scheme * handle python exception * better state management * add webworker * add headers * format code * speed up by loading pyodide on page load * (small tweak) add small animation to make it feels like claude
In this PR:
The python interpreter uses pyodide under the hood, which is CPython compiled as webassembly. Due to big bundle size, this feature requires internet connection to download the pyodide and wasm file from CDN.
Test with a real world problem