mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
ebf998acb6
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com> Co-authored-by: Lance Martin <lance@langchain.dev> Co-authored-by: Jacob Lee <jacoblee93@gmail.com>
1.2 KiB
1.2 KiB
SQL with LLaMA2 using Ollama
This template allows you to chat with a SQL database in natural language in private, using an open source LLM.
LLama.cpp
Enviorment
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
conda create -n llama python=3.9.16
conda activate /Users/rlm/miniforge3/envs/llama
CMAKE_ARGS="-DLLAMA_METAL=on" FORCE_CMAKE=1 pip install -U llama-cpp-python --no-cache-dir
LLM
It will download Mistral-7b model from here.
You can select other files and specify their download path (browse here).
Set up SQL DB
This template includes an example DB of 2023 NBA rosters.
You can see instructions to build this DB here.
Installation
# from inside your LangServe instance
poe add sql/llama2-ollama