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

  1. Verify that Python 3.10+ and pip are installed:

python3 --version
pip3 --version
  1. If not installed (for Debian/Ubuntu-based distros):

sudo apt update
sudo apt install python3.10 -y
sudo apt install python3-pip -y
  1. Install python3.10-venv for virtual environment support:

sudo apt install python3.10-venv
  1. Create a virtual environment:

python3.10 -m venv env   # "env" is the environment name
  1. Activate the environment:

source env/bin/activate
  1. Install Langformers (and any extras):

pip install -U langformers

You’re now ready to use Langformers! 🚀