nixpkgs/pkgs/by-name/op/open-webui/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

162 lines
3.3 KiB
Nix
Raw Permalink Normal View History

2024-06-04 04:36:51 -06:00
{
lib,
buildNpmPackage,
fetchFromGitHub,
python312,
2024-06-04 04:36:51 -06:00
nixosTests,
}:
let
pname = "open-webui";
version = "0.4.7";
2024-06-04 04:36:51 -06:00
src = fetchFromGitHub {
owner = "open-webui";
repo = "open-webui";
2024-09-06 03:52:40 -06:00
rev = "refs/tags/v${version}";
hash = "sha256-LQFedDcECmS142tGH9+/7ic+wKTeMuysK2fjGmvYPYQ=";
2024-06-04 04:36:51 -06:00
};
frontend = buildNpmPackage {
inherit pname version src;
npmDepsHash = "sha256-KeHMt51QvF5qfHKQpEbM0ukGm34xo3TFcXKeZ3CrmHM=";
2024-06-04 04:36:51 -06:00
# Disabling `pyodide:fetch` as it downloads packages during `buildPhase`
# Until this is solved, running python packages from the browser will not work.
postPatch = ''
substituteInPlace package.json \
2024-09-06 03:52:40 -06:00
--replace-fail "npm run pyodide:fetch && vite build" "vite build"
2024-06-04 04:36:51 -06:00
'';
env.CYPRESS_INSTALL_BINARY = "0"; # disallow cypress from downloading binaries in sandbox
env.ONNXRUNTIME_NODE_INSTALL_CUDA = "skip";
2024-11-28 09:38:51 -07:00
env.NODE_OPTIONS = "--max-old-space-size=8192";
2024-06-04 04:36:51 -06:00
installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -a build $out/share/open-webui
runHook postInstall
'';
};
in
python312.pkgs.buildPythonApplication rec {
2024-06-04 04:36:51 -06:00
inherit pname version src;
pyproject = true;
# Not force-including the frontend build directory as frontend is managed by the `frontend` derivation above.
2024-06-04 04:36:51 -06:00
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail ', build = "open_webui/frontend"' ""
'';
env.HATCH_BUILD_NO_HOOKS = true;
2024-06-04 04:36:51 -06:00
pythonRelaxDeps = true;
pythonRemoveDeps = [
"docker"
"pytest"
"pytest-docker"
2024-06-04 04:36:51 -06:00
];
dependencies = with python312.pkgs; [
aiocache
aiofiles
aiohttp
alembic
anthropic
apscheduler
argon2-cffi
async-timeout
authlib
bcrypt
2024-06-04 04:36:51 -06:00
beautifulsoup4
black
boto3
chromadb
colbert-ai
docx2txt
duckduckgo-search
einops
emoji # This dependency is missing in upstream's pyproject.toml
extract-msg
fake-useragent
2024-06-04 04:36:51 -06:00
fastapi
faster-whisper
2024-06-04 04:36:51 -06:00
flask
flask-cors
fpdf2
ftfy
google-generativeai
googleapis-common-protos
langchain
langchain-chroma
langchain-community
langfuse
ldap3
markdown
nltk
openai
opencv-python-headless
openpyxl
opensearch-py
pandas
2024-06-04 04:36:51 -06:00
passlib
peewee
peewee-migrate
pgvector
2024-07-17 08:29:13 -06:00
psutil
psycopg2-binary
pydub
pyjwt
pymdown-extensions
pymilvus
pymongo
2024-06-04 04:36:51 -06:00
pymysql
pypandoc
2024-06-04 04:36:51 -06:00
pypdf
python-dotenv
python-jose
python-multipart
2024-06-04 04:36:51 -06:00
python-pptx
python-socketio
pytube
2024-06-04 04:36:51 -06:00
pyxlsb
qdrant-client
2024-06-04 04:36:51 -06:00
rank-bm25
rapidocr-onnxruntime
redis
requests
sentence-transformers
soundfile
2024-07-17 08:29:13 -06:00
tiktoken
unstructured
uvicorn
validators
xlrd
2024-06-04 04:36:51 -06:00
youtube-transcript-api
];
build-system = with python312.pkgs; [ hatchling ];
2024-06-04 04:36:51 -06:00
pythonImportsCheck = [ "open_webui" ];
makeWrapperArgs = [ "--set FRONTEND_BUILD_DIR ${frontend}/share/open-webui" ];
2024-06-04 04:36:51 -06:00
passthru.tests = {
inherit (nixosTests) open-webui;
};
meta = {
changelog = "https://github.com/open-webui/open-webui/blob/${src.rev}/CHANGELOG.md";
description = "Comprehensive suite for LLMs with a user-friendly WebUI";
2024-06-04 04:36:51 -06:00
homepage = "https://github.com/open-webui/open-webui";
license = lib.licenses.mit;
mainProgram = "open-webui";
maintainers = with lib.maintainers; [ shivaraj-bh ];
2024-06-04 04:36:51 -06:00
};
}