0
stars
5,603
commits
Python
primary language
Feb 29, 2024
updated
Turn ★ into ⭐ (top-right corner) if you like the project!
Query and summarize your documents or just chat with local private GPT LLMs using h2oGPT, an Apache V2 open-source project.
To quickly try out h2oGPT with limited document Q/A capability, create a fresh Python 3.10 environment and run:
# for windows/mac use "set" or relevant environment setting mechanism
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
# for windows/mac use "set" or relevant environment setting mechanism
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu121 https://huggingface.github.io/autogptq-index/whl/cu121"
# for cu118 use export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu118 https://huggingface.github.io/autogptq-index/whl/cu118"
Then run the following commands on any system:
git clone https://github.com/h2oai/h2ogpt.git
cd h2ogpt
pip install -r requirements.txt
pip install -r reqs_optional/requirements_optional_langchain.txt
# default uses cu121, for cu118, comment out cu121 and comment in similar cu118 wheels
# for no avx, comment-out avx wheels and choose ones without avx
# for AMD ROC, comment-out all except the correct ROC wheel
pip install -r reqs_optional/requirements_optional_gpt4all.txt
pip install -r reqs_optional/requirements_optional_langchain.urls.txt
# GPL, only run next line if that is ok:
# pip install -r reqs_optional/requirements_optional_langchain.gpllike.txt
python generate.py --base_model=TheBloke/zephyr-7B-beta-GGUF --prompt_type=zephyr --max_seq_len=4096
Next, go to your browser by visiting http://127.0.0.1:7860 or http://localhost:7860. Choose 13B for a better model than 7B.
If you encounter issues with llama-cpp-python or other packages that try to compile and fail, try binary wheels for your platform as linked in the detailed instructions below. For AVX1 or AMD ROC systems, edit reqs_optional/requirements_optional_gpt4all.txt to choose valid packages.
We recommend quantized models for most small-GPU systems, e.g. LLaMa-2-7B-Chat-GGUF for 9GB+ GPU memory or larger models like LLaMa-2-13B-Chat-GGUF if you have 16GB+ GPU memory.
See Offline for how to run h2oGPT offline.
Note that for all platforms, some packages such as DocTR, Unstructured, BLIP, Stable Diffusion, etc. download models at runtime that appear to delay operations in the UI. The progress appears in the console logs.
One-Click Installer
%HOMEDRIVE%\%HOMEPATH% to (e.g.) %HOMEDRIVE%\%HOMEPATH%\h2ogpt_data so all created files (like database) go there. All paths saved are relative to this path.pseud with your user):
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe -m pip uninstall -y torch
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe -m pip install https://h2o-release.s3.amazonaws.com/h2ogpt/torch-2.1.2%2Bcu118-cp310-cp310-win_amd64.whl
Now click the h2oGPT icon in the Start menu. Give it about 20 seconds to open in a browser if many optional packages are included. By default, the browser will launch with the actual local IP address, not localhost.
C:\Program Files (x86)\h2oGPT\Python\python.exe.pseud with your user):
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe "C:\Users\pseud\AppData\Local\Programs\h2oGPT\h2oGPT.launch.pyw"
Any start-up exceptions are appended to log, e.g. C:\Users\pseud\h2ogpt_exception.log.To control startup, tweak the python startup file, e.g. for user pseud: C:\Users\pseud\AppData\Local\Programs\h2oGPT\pkgs\win_run_app.py
os.environ['name'] = 'value', e.g. os.environ['n_jobs'] = '10' (must be always a string).n_jobs: number of cores for various tasksOMP_NUM_THREADS thread count for LLaMaCUDA_VISIBLE_DEVICES which GPUs are used. Recommend set to single fast GPU, e.g. CUDA_VISIBLE_DEVICES=0 if have multiple GPUs. Note that UI cannot control which GPUs (or CPU mode) for LLaMa models.python generate.py --help with environment variable set as h2ogpt_x, e.g. h2ogpt_h2ocolors to False.h2ogpt_server_name to actual IP address for LAN to see app, e.g. h2ogpt_server_name to 192.168.1.172 and allow access through firewall if have Windows Defender activated.One can tweak installed h2oGPT code at, e.g. C:\Users\pseud\AppData\Local\Programs\h2oGPT.
To terminate the app, go to System Tab and click Admin and click Shutdown h2oGPT.
Full Windows 10/11 Manual Installation Script
.bat file for installation (if you do not skip any optional packages, takes about 9GB filled on disk).mysys2 that cannot be used by h2oGPT).One-click Installers (Experimental and subject to changes)
Nov 08, 2023
Download the runnable file and open it from the Finder. It will take a few minutes to unpack and run the application. These one-click installers are experimental. Report any issues with steps to reproduce at https://github.com/h2oai/h2ogpt/issues.
Note: The app bundle is unsigned. If you experience any issues with running the app, run the following commands:
$ xattr -dr com.apple.quarantine {file-path}/h2ogpt-osx-m1-gpu
$ chmod +x {file-path}/h2ogpt-osx-m1-gpu
GPU mode requires CUDA support via torch and transformers. A 7B/13B model in 16-bit uses 14GB/26GB of GPU memory to store the weights (2 bytes per weight). Compression such as 4-bit precision (bitsandbytes, AWQ, GPTQ, etc.) can further reduce memory requirements down to less than 6GB when asking a question about your documents. (For more information, see low-memory mode.)
CPU mode uses GPT4ALL and LLaMa.cpp, e.g. gpt4all-j, requiring about 14GB of system RAM in typical use.
Live h2oGPT Document Q/A Demohttps://github.com/h2oai/h2ogpt/assets/2249614/2f805035-2c85-42fb-807f-fd0bca79abc6
YouTube 4K version: https://www.youtube.com/watch?v=_iktbj4obAI
These are not part of normal installation instructions and are experimental.
pip install requirements-parser pytest-instafail pytest-random-order playsound==1.3.0
pytest --instafail -s -v tests
# for client tests
make -C client setup
make -C client build
pytest --instafail -s -v client/tests
# for openai server test on already-running local server
pytest -s -v -n 4 openai_server/test_openai_server.py::test_openai_client
or tweak/run tests/test4gpus.sh to run tests in parallel.Useful links for additional context and information on competitors, models, and datasets
Our Makers at H2O.ai have built several world-class Machine Learning, Deep Learning and AI platforms:
We also built platforms for deployment and monitoring, and for data wrangling and governance:
Many of our customers are creating models and deploying them enterprise-wide and at scale in the H2O AI Cloud:
We are proud to have over 25 (of the world's 280) Kaggle Grandmasters call H2O home, including three Kaggle Grandmasters who have made it to world #1.
Please read this disclaimer carefully before using the large language model provided in this repository. Your use of the model signifies your agreement to the following terms and conditions.
By using the large language model provided in this repository, you agree to accept and comply with the terms and conditions outlined in this disclaimer. If you do not agree with any part of this disclaimer, you should refrain from using the model and any content generated by it.
(top 30 of 63)
Python
91.0%
Jupyter Notebook
3.3%
TeX
2.6%
HTML
1.9%
0
stars
5,603
commits
Python
primary language
Feb 29, 2024
updated
Turn ★ into ⭐ (top-right corner) if you like the project!
Query and summarize your documents or just chat with local private GPT LLMs using h2oGPT, an Apache V2 open-source project.
To quickly try out h2oGPT with limited document Q/A capability, create a fresh Python 3.10 environment and run:
# for windows/mac use "set" or relevant environment setting mechanism
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
# for windows/mac use "set" or relevant environment setting mechanism
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu121 https://huggingface.github.io/autogptq-index/whl/cu121"
# for cu118 use export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu118 https://huggingface.github.io/autogptq-index/whl/cu118"
Then run the following commands on any system:
git clone https://github.com/h2oai/h2ogpt.git
cd h2ogpt
pip install -r requirements.txt
pip install -r reqs_optional/requirements_optional_langchain.txt
# default uses cu121, for cu118, comment out cu121 and comment in similar cu118 wheels
# for no avx, comment-out avx wheels and choose ones without avx
# for AMD ROC, comment-out all except the correct ROC wheel
pip install -r reqs_optional/requirements_optional_gpt4all.txt
pip install -r reqs_optional/requirements_optional_langchain.urls.txt
# GPL, only run next line if that is ok:
# pip install -r reqs_optional/requirements_optional_langchain.gpllike.txt
python generate.py --base_model=TheBloke/zephyr-7B-beta-GGUF --prompt_type=zephyr --max_seq_len=4096
Next, go to your browser by visiting http://127.0.0.1:7860 or http://localhost:7860. Choose 13B for a better model than 7B.
If you encounter issues with llama-cpp-python or other packages that try to compile and fail, try binary wheels for your platform as linked in the detailed instructions below. For AVX1 or AMD ROC systems, edit reqs_optional/requirements_optional_gpt4all.txt to choose valid packages.
We recommend quantized models for most small-GPU systems, e.g. LLaMa-2-7B-Chat-GGUF for 9GB+ GPU memory or larger models like LLaMa-2-13B-Chat-GGUF if you have 16GB+ GPU memory.
See Offline for how to run h2oGPT offline.
Note that for all platforms, some packages such as DocTR, Unstructured, BLIP, Stable Diffusion, etc. download models at runtime that appear to delay operations in the UI. The progress appears in the console logs.
One-Click Installer
%HOMEDRIVE%\%HOMEPATH% to (e.g.) %HOMEDRIVE%\%HOMEPATH%\h2ogpt_data so all created files (like database) go there. All paths saved are relative to this path.pseud with your user):
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe -m pip uninstall -y torch
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe -m pip install https://h2o-release.s3.amazonaws.com/h2ogpt/torch-2.1.2%2Bcu118-cp310-cp310-win_amd64.whl
Now click the h2oGPT icon in the Start menu. Give it about 20 seconds to open in a browser if many optional packages are included. By default, the browser will launch with the actual local IP address, not localhost.
C:\Program Files (x86)\h2oGPT\Python\python.exe.pseud with your user):
C:\Users\pseud\AppData\Local\Programs\h2oGPT\Python\python.exe "C:\Users\pseud\AppData\Local\Programs\h2oGPT\h2oGPT.launch.pyw"
Any start-up exceptions are appended to log, e.g. C:\Users\pseud\h2ogpt_exception.log.To control startup, tweak the python startup file, e.g. for user pseud: C:\Users\pseud\AppData\Local\Programs\h2oGPT\pkgs\win_run_app.py
os.environ['name'] = 'value', e.g. os.environ['n_jobs'] = '10' (must be always a string).n_jobs: number of cores for various tasksOMP_NUM_THREADS thread count for LLaMaCUDA_VISIBLE_DEVICES which GPUs are used. Recommend set to single fast GPU, e.g. CUDA_VISIBLE_DEVICES=0 if have multiple GPUs. Note that UI cannot control which GPUs (or CPU mode) for LLaMa models.python generate.py --help with environment variable set as h2ogpt_x, e.g. h2ogpt_h2ocolors to False.h2ogpt_server_name to actual IP address for LAN to see app, e.g. h2ogpt_server_name to 192.168.1.172 and allow access through firewall if have Windows Defender activated.One can tweak installed h2oGPT code at, e.g. C:\Users\pseud\AppData\Local\Programs\h2oGPT.
To terminate the app, go to System Tab and click Admin and click Shutdown h2oGPT.
Full Windows 10/11 Manual Installation Script
.bat file for installation (if you do not skip any optional packages, takes about 9GB filled on disk).mysys2 that cannot be used by h2oGPT).One-click Installers (Experimental and subject to changes)
Nov 08, 2023
Download the runnable file and open it from the Finder. It will take a few minutes to unpack and run the application. These one-click installers are experimental. Report any issues with steps to reproduce at https://github.com/h2oai/h2ogpt/issues.
Note: The app bundle is unsigned. If you experience any issues with running the app, run the following commands:
$ xattr -dr com.apple.quarantine {file-path}/h2ogpt-osx-m1-gpu
$ chmod +x {file-path}/h2ogpt-osx-m1-gpu
GPU mode requires CUDA support via torch and transformers. A 7B/13B model in 16-bit uses 14GB/26GB of GPU memory to store the weights (2 bytes per weight). Compression such as 4-bit precision (bitsandbytes, AWQ, GPTQ, etc.) can further reduce memory requirements down to less than 6GB when asking a question about your documents. (For more information, see low-memory mode.)
CPU mode uses GPT4ALL and LLaMa.cpp, e.g. gpt4all-j, requiring about 14GB of system RAM in typical use.
Live h2oGPT Document Q/A Demohttps://github.com/h2oai/h2ogpt/assets/2249614/2f805035-2c85-42fb-807f-fd0bca79abc6
YouTube 4K version: https://www.youtube.com/watch?v=_iktbj4obAI
These are not part of normal installation instructions and are experimental.
pip install requirements-parser pytest-instafail pytest-random-order playsound==1.3.0
pytest --instafail -s -v tests
# for client tests
make -C client setup
make -C client build
pytest --instafail -s -v client/tests
# for openai server test on already-running local server
pytest -s -v -n 4 openai_server/test_openai_server.py::test_openai_client
or tweak/run tests/test4gpus.sh to run tests in parallel.Useful links for additional context and information on competitors, models, and datasets
Our Makers at H2O.ai have built several world-class Machine Learning, Deep Learning and AI platforms:
We also built platforms for deployment and monitoring, and for data wrangling and governance:
Many of our customers are creating models and deploying them enterprise-wide and at scale in the H2O AI Cloud:
We are proud to have over 25 (of the world's 280) Kaggle Grandmasters call H2O home, including three Kaggle Grandmasters who have made it to world #1.
Please read this disclaimer carefully before using the large language model provided in this repository. Your use of the model signifies your agreement to the following terms and conditions.
By using the large language model provided in this repository, you agree to accept and comply with the terms and conditions outlined in this disclaimer. If you do not agree with any part of this disclaimer, you should refrain from using the model and any content generated by it.
(top 30 of 63)
Python
91.0%
Jupyter Notebook
3.3%
TeX
2.6%
HTML
1.9%