juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
299 stars 28 forks source link

feat(open-webui): init #219

Closed shivaraj-bh closed 1 month ago

shivaraj-bh commented 1 month ago

ported from: https://github.com/shivaraj-bh/ollama-flake/blob/main/services/open-webui.nix

This was also recently upstreamed to nixpkgs: https://github.com/NixOS/nixpkgs/pull/316248

TODO:

shivaraj-bh commented 1 month ago

Ready for preview:

nix run "github:juspay/services-flake/open-webui?dir=example/llm"
srid commented 1 month ago

Ready for preview:

I get the following on mac:

       error: The option `perSystem.aarch64-darwin.process-compose.default.services.open-webui' does not exist. Definition values:
       - In `/nix/store/7a9x52qf14dkvnhj4219jd0i5l9yhdj3-source/example/llm/flake.nix, via option perSystem':
           {
             open-webui1 = {
               enable = true;
               environment = {
                 OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
shivaraj-bh commented 1 month ago

Ready for preview:

I get the following on mac:

       error: The option `perSystem.aarch64-darwin.process-compose.default.services.open-webui' does not exist. Definition values:
       - In `/nix/store/7a9x52qf14dkvnhj4219jd0i5l9yhdj3-source/example/llm/flake.nix, via option perSystem':
           {
             open-webui1 = {
               enable = true;
               environment = {
                 OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";

Ah sorry (I was just checking with just ex-llm in devShell), this should work:

 nix run "github:juspay/services-flake/open-webui?dir=example/llm" --refresh --override-input services-flake github:juspay/services-flake/open-webui
srid commented 1 month ago

The processes are running in two different namespaces (default and ollama1) ... shouldn't they be under the same namespace?

image
shivaraj-bh commented 1 month ago

The processes are running in two different namespaces (default and ollama1) ... shouldn't they be under the same namespace?

image

In our current design, every service belongs to its own namespace. We could manually modify this, if that’s what we desire here.

srid commented 1 month ago

Fantastic, worked on mac!

image image
srid commented 1 month ago

In our current design, every service belongs to its own namespace.

I don't remember what we do. But this doesn't seem to be the case for the llm example because only the ollama1 service is running in its own namespace (ollama1). Not the open-webui1 service, as it is running in the default namespace.

shivaraj-bh commented 1 month ago

In our current design, every service belongs to its own namespace.

I don't remember what we do. But this doesn't seem to be the case for the llm example because only the ollama1 service is running in its own namespace (ollama1). Not the open-webui1 service, as it is running in the default namespace.

Fixed it in the recent commit

srid commented 1 month ago

Fixed it in the recent commit

Re-ran nix run and everything still works (re-using the already downloaded models). This will be a cool video demo (especially if it finishes with writing prompts in the browser app).

shivaraj-bh commented 1 month ago

Thanks for all the feedback @srid and @drupol! ❤️