2024-06-04 04:36:51 -06:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildNpmPackage,
|
|
|
|
fetchFromGitHub,
|
2024-11-20 04:24:18 -07:00
|
|
|
python312,
|
2024-06-04 04:36:51 -06:00
|
|
|
nixosTests,
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "open-webui";
|
2024-12-01 02:01:57 -07:00
|
|
|
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}";
|
2024-12-01 02:01:57 -07:00
|
|
|
hash = "sha256-LQFedDcECmS142tGH9+/7ic+wKTeMuysK2fjGmvYPYQ=";
|
2024-06-04 04:36:51 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
frontend = buildNpmPackage {
|
|
|
|
inherit pname version src;
|
|
|
|
|
2024-12-01 02:01:57 -07:00
|
|
|
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
|
2024-10-24 14:47:25 -06:00
|
|
|
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
|
2024-11-20 04:24:18 -07:00
|
|
|
python312.pkgs.buildPythonApplication rec {
|
2024-06-04 04:36:51 -06:00
|
|
|
inherit pname version src;
|
|
|
|
pyproject = true;
|
|
|
|
|
2024-06-13 00:51:36 -06:00
|
|
|
# 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"' ""
|
|
|
|
'';
|
|
|
|
|
2024-06-13 00:51:36 -06:00
|
|
|
env.HATCH_BUILD_NO_HOOKS = true;
|
|
|
|
|
2024-06-04 04:36:51 -06:00
|
|
|
pythonRelaxDeps = true;
|
|
|
|
|
|
|
|
pythonRemoveDeps = [
|
2024-08-07 08:19:13 -06:00
|
|
|
"docker"
|
|
|
|
"pytest"
|
|
|
|
"pytest-docker"
|
2024-06-04 04:36:51 -06:00
|
|
|
];
|
|
|
|
|
2024-11-20 04:24:18 -07:00
|
|
|
dependencies = with python312.pkgs; [
|
|
|
|
aiocache
|
2024-11-26 11:06:07 -07:00
|
|
|
aiofiles
|
2024-06-10 04:23:27 -06:00
|
|
|
aiohttp
|
2024-07-11 09:34:01 -06:00
|
|
|
alembic
|
2024-06-28 11:50:21 -06:00
|
|
|
anthropic
|
2024-06-10 04:23:27 -06:00
|
|
|
apscheduler
|
|
|
|
argon2-cffi
|
2024-10-24 14:47:25 -06:00
|
|
|
async-timeout
|
2024-06-28 11:50:21 -06:00
|
|
|
authlib
|
2024-06-10 04:23:27 -06:00
|
|
|
bcrypt
|
2024-06-04 04:36:51 -06:00
|
|
|
beautifulsoup4
|
2024-06-10 04:23:27 -06:00
|
|
|
black
|
|
|
|
boto3
|
|
|
|
chromadb
|
2024-09-19 16:29:59 -06:00
|
|
|
colbert-ai
|
2024-06-10 04:23:27 -06:00
|
|
|
docx2txt
|
2024-06-12 05:42:44 -06:00
|
|
|
duckduckgo-search
|
2024-09-19 16:29:59 -06:00
|
|
|
einops
|
2024-12-02 23:48:55 -07:00
|
|
|
emoji # This dependency is missing in upstream's pyproject.toml
|
2024-06-10 04:23:27 -06:00
|
|
|
extract-msg
|
|
|
|
fake-useragent
|
2024-06-04 04:36:51 -06:00
|
|
|
fastapi
|
2024-06-10 04:23:27 -06:00
|
|
|
faster-whisper
|
2024-06-04 04:36:51 -06:00
|
|
|
flask
|
|
|
|
flask-cors
|
2024-06-10 04:23:27 -06:00
|
|
|
fpdf2
|
2024-10-07 05:27:45 -06:00
|
|
|
ftfy
|
2024-06-10 04:23:27 -06:00
|
|
|
google-generativeai
|
2024-09-18 13:21:39 -06:00
|
|
|
googleapis-common-protos
|
2024-06-10 04:23:27 -06:00
|
|
|
langchain
|
|
|
|
langchain-chroma
|
|
|
|
langchain-community
|
|
|
|
langfuse
|
2024-11-20 04:24:18 -07:00
|
|
|
ldap3
|
2024-06-10 04:23:27 -06:00
|
|
|
markdown
|
2024-08-28 15:19:13 -06:00
|
|
|
nltk
|
2024-06-28 11:50:21 -06:00
|
|
|
openai
|
2024-10-27 10:58:23 -06:00
|
|
|
opencv-python-headless
|
2024-06-10 04:23:27 -06:00
|
|
|
openpyxl
|
2024-11-20 04:24:18 -07:00
|
|
|
opensearch-py
|
2024-06-10 04:23:27 -06:00
|
|
|
pandas
|
2024-06-04 04:36:51 -06:00
|
|
|
passlib
|
|
|
|
peewee
|
|
|
|
peewee-migrate
|
2024-11-20 04:24:18 -07:00
|
|
|
pgvector
|
2024-07-17 08:29:13 -06:00
|
|
|
psutil
|
2024-10-27 10:58:23 -06:00
|
|
|
psycopg2-binary
|
2024-06-11 00:54:22 -06:00
|
|
|
pydub
|
2024-06-10 04:23:27 -06:00
|
|
|
pyjwt
|
2024-10-24 14:47:25 -06:00
|
|
|
pymdown-extensions
|
2024-09-19 16:29:59 -06:00
|
|
|
pymilvus
|
2024-06-28 11:50:21 -06:00
|
|
|
pymongo
|
2024-06-04 04:36:51 -06:00
|
|
|
pymysql
|
2024-06-10 04:23:27 -06:00
|
|
|
pypandoc
|
2024-06-04 04:36:51 -06:00
|
|
|
pypdf
|
2024-08-01 04:43:47 -06:00
|
|
|
python-dotenv
|
2024-06-10 04:23:27 -06:00
|
|
|
python-jose
|
|
|
|
python-multipart
|
2024-06-04 04:36:51 -06:00
|
|
|
python-pptx
|
2024-06-10 04:23:27 -06:00
|
|
|
python-socketio
|
|
|
|
pytube
|
2024-06-04 04:36:51 -06:00
|
|
|
pyxlsb
|
2024-11-20 04:24:18 -07:00
|
|
|
qdrant-client
|
2024-06-04 04:36:51 -06:00
|
|
|
rank-bm25
|
2024-06-17 13:08:41 -06:00
|
|
|
rapidocr-onnxruntime
|
2024-06-28 11:50:21 -06:00
|
|
|
redis
|
2024-06-10 04:23:27 -06:00
|
|
|
requests
|
|
|
|
sentence-transformers
|
2024-11-20 04:24:18 -07:00
|
|
|
soundfile
|
2024-07-17 08:29:13 -06:00
|
|
|
tiktoken
|
2024-06-10 04:23:27 -06:00
|
|
|
unstructured
|
|
|
|
uvicorn
|
|
|
|
validators
|
|
|
|
xlrd
|
2024-06-04 04:36:51 -06:00
|
|
|
youtube-transcript-api
|
|
|
|
];
|
|
|
|
|
2024-11-20 04:24:18 -07:00
|
|
|
build-system = with python312.pkgs; [ hatchling ];
|
2024-06-13 00:51:36 -06:00
|
|
|
|
2024-06-04 04:36:51 -06:00
|
|
|
pythonImportsCheck = [ "open_webui" ];
|
|
|
|
|
2024-06-13 00:51:36 -06:00
|
|
|
makeWrapperArgs = [ "--set FRONTEND_BUILD_DIR ${frontend}/share/open-webui" ];
|
2024-06-04 04:36:51 -06:00
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) open-webui;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2024-11-20 04:24:18 -07:00
|
|
|
changelog = "https://github.com/open-webui/open-webui/blob/${src.rev}/CHANGELOG.md";
|
2024-07-31 04:45:50 -06:00
|
|
|
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";
|
2024-11-20 04:24:18 -07:00
|
|
|
maintainers = with lib.maintainers; [ shivaraj-bh ];
|
2024-06-04 04:36:51 -06:00
|
|
|
};
|
|
|
|
}
|