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

feat(open-webui): init #219

Merged
merged 2 commits into from
Jun 13, 2024
Merged

feat(open-webui): init #219

merged 2 commits into from
Jun 13, 2024

Conversation

shivaraj-bh
Copy link
Member

@shivaraj-bh shivaraj-bh commented Jun 11, 2024

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

This was also recently upstreamed to nixpkgs: NixOS/nixpkgs#316248

TODO:

  • Document how to use it with ollama service
  • Use open-browser process in example and documentation

nix/open-webui.nix Outdated Show resolved Hide resolved
nix/open-webui.nix Outdated Show resolved Hide resolved
nix/open-webui.nix Outdated Show resolved Hide resolved
doc/open-webui.md Outdated Show resolved Hide resolved
doc/open-webui.md Outdated Show resolved Hide resolved
doc/open-webui.md Outdated Show resolved Hide resolved
example/llm/flake.nix Outdated Show resolved Hide resolved
@shivaraj-bh
Copy link
Member Author

Ready for preview:

nix run "github:juspay/services-flake/open-webui?dir=example/llm"

@shivaraj-bh shivaraj-bh marked this pull request as ready for review June 13, 2024 20:26
@srid
Copy link
Member

srid commented Jun 13, 2024

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";

example/llm/flake.nix Outdated Show resolved Hide resolved
@shivaraj-bh
Copy link
Member Author

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

example/llm/flake.nix Outdated Show resolved Hide resolved
@srid
Copy link
Member

srid commented Jun 13, 2024

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

image

@shivaraj-bh
Copy link
Member Author

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
Copy link
Member

srid commented Jun 13, 2024

Fantastic, worked on mac!

image image

@srid
Copy link
Member

srid commented Jun 13, 2024

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
Copy link
Member Author

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
Copy link
Member

srid commented Jun 13, 2024

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).

Copy link
Member

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, once the hardcoded strings in the docs are addressed.

shivaraj-bh and others added 2 commits June 14, 2024 03:02
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/tree/master):
NixOS/nixpkgs#316248

---------

Co-authored-by: Pol Dellaiera <[email protected]>
Co-authored-by: Sridhar Ratnakumar <[email protected]>
Easy to break the convention, see:
#200

double-quotting in shell script prevents globbing:
https://www.shellcheck.net/wiki/SC2086
@shivaraj-bh shivaraj-bh enabled auto-merge (rebase) June 13, 2024 21:35
@shivaraj-bh
Copy link
Member Author

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

@shivaraj-bh shivaraj-bh merged commit db7ab71 into main Jun 13, 2024
4 checks passed
@shivaraj-bh shivaraj-bh deleted the open-webui branch June 13, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants