Skip to content
View langformers's full-sized avatar

Block or report langformers

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
langformers/README.md

PyPI Python License Docs

Langformers

Langformers is a flexible and user-friendly library that unifies NLP pipelines for both Large Language Models (LLMs) and Masked Language Models (MLMs) into one simple API.

What makes Langformers special? Whether you're generating text, training classifiers, labelling data, embedding sentences, reranking sentences, or building a semantic search index... the API stays consistent:

from langformers import tasks

component = tasks.create_<something>(...)
component.<do_something>()

No need to juggle different frameworks — Langformers brings Hugging Face Transformers, Ollama, FAISS, ChromaDB, Pinecone, and more under one unified interface.

Use the same pattern everywhere:

tasks.create_generator(...)   # Chatting with LLMs
tasks.create_labeller(...)    # Data labelling using LLMs
tasks.create_embedder(...)    # Embeding Sentences
tasks.create_reranker(...)    # Reranking Sentences
tasks.create_classifier(...)  # Training a Text Classifier
tasks.create_tokenizer()      # Training a Custom Tokenizer
tasks.create_mlm(...)         # Pretraining an MLM
tasks.create_searcher(...)    # Vector Database search
tasks.create_mimicker(...)    # Knowledge Distillation
tasks.create_chunker(...)     # Chunking for LLMs

Installation

Langformers can be installed using pip.

pip install -U langformers

This installs the latest version with core dependencies.

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]

Supported Tasks

Below are the pre-built NLP tasks available in Langformers. Each link points to an example in the documentation to help you get started quickly.

Generative LLMs (e.g., Llama, Mistral, DeepSeek)

Masked Language Models (e.g., RoBERTa)

Embeddings & Search (e.g., Sentence Transformers, FAISS, Pinecone)

Documentation

Complete documentation and advanced usage examples are available at: https://langformers.com.

License

Langformers is released under the Apache License 2.0.

Contributing

We welcome contributions! Please see our contribution guidelines for details.


Built with ❤️ for the future of language AI.

Popular repositories Loading

  1. langformers langformers Public

    🚀 Unified NLP Pipelines for Language Models

    Python 19 1