12 src = fetchFromGitHub {
16 hash = "sha256-Q8ZUc3fNfWeijPLUtgwkU2rv7SWSfi7Q1QOlt14O3nE= ";
19 frontend = buildNpmPackage {
20 inherit pname version src;
22 npmDepsHash = "sha256-nkJksj1FAOMqEDQS1k++E2izv9TT3PkoZLxzHIcHzvA=";
24 # Disabling `pyodide:fetch` as it downloads packages during `buildPhase`
25 # Until this is solved, running python packages from the browser will not work.
27 substituteInPlace package.json \
28 --replace-fail "npm run pyodide:fetch && vite build" "vite build" \
31 env.CYPRESS_INSTALL_BINARY = "0"; # disallow cypress from downloading binaries in sandbox
37 cp -a build $out/share/open-webui
43 python3.pkgs.buildPythonApplication rec {
44 inherit pname version src;
47 # Not force-including the frontend build directory as frontend is managed by the `frontend` derivation above.
49 substituteInPlace pyproject.toml \
50 --replace-fail ', build = "open_webui/frontend"' ""
53 env.HATCH_BUILD_NO_HOOKS = true;
55 pythonRelaxDeps = true;
59 "opencv-python-headless"
60 # using `psycopg2` instead
64 dependencies = with python3.pkgs; [
116 sentence-transformers
123 youtube-transcript-api
126 build-system = with python3.pkgs; [ hatchling ];
129 pythonImportsCheck = [ "open_webui" ];
131 makeWrapperArgs = [ "--set FRONTEND_BUILD_DIR ${frontend}/share/open-webui" ];
134 inherit (nixosTests) open-webui;
138 description = "Full-stack of open-webui. open-webui is a user-friendly WebUI for LLMs (Formerly Ollama WebUI)";
139 homepage = "https://github.com/open-webui/open-webui";
140 changelog = "https://github.com/open-webui/open-webui/blob/${src.rev}/CHANGELOG.md";
141 license = lib.licenses.mit;
142 maintainers = with lib.maintainers; [ shivaraj-bh ];
143 mainProgram = "open-webui";