Installation
Langformers requires Python 3.10 or later. Its installation is simple!
Note
It’s highly recommended to install Langformers in a virtual environment to avoid dependency conflicts. Follow the Platform-specific Instructions.
To install Langformers globally:
pip install -U langformers
This installs the latest version with core dependencies. If you need support for specific features (e.g., FAISS for vector search), you can install optional dependencies as well.
Optional Dependencies
Langformers includes optional integrations you can install depending on your use case:
For FAISS support:
pip install -U langformers[faiss]
For ChromaDB support:
pip install -U langformers[chromadb]
For Pinecone support:
pip install -U langformers[pinecone]
To install all optional features:
pip install -U langformers[all]
Important
If you use zsh, wrap everything after pip install
in quotes to avoid shell interpretation. Example:
pip install "langformers[faiss]"
This applies to zsh and any shell that might treat [] as a glob pattern.
Platform-specific Instructions
Verify that Python 3.10+ and pip are installed:
python3 --version pip3 --version
If not installed (for Debian/Ubuntu-based distros):
sudo apt update sudo apt install python3.10 -y sudo apt install python3-pip -y
Install python3.10-venv for virtual environment support:
sudo apt install python3.10-venv
Create a virtual environment:
python3.10 -m venv env # "env" is the environment name
Activate the environment:
source env/bin/activate
Install Langformers (and any extras):
pip install -U langformers
Verify Python 3.10+ and pip:
python3 --version pip3 --version
If not installed, use Homebrew:
brew install python@3.10
Create a virtual environment:
python3.10 -m venv env
Activate the environment:
source env/bin/activate
Install Langformers (and any extras):
pip install -U langformers
Verify Python 3.10+ and pip:
python --version pip --version
If not installed, download from: https://www.python.org/downloads/
Create a virtual environment:
python -m venv env
Activate the environment:
env\Scripts\activate
Install Langformers (and any extras):
pip install -U langformers
You’re now ready to use Langformers! 🚀