Home
Softono
langformers

langformers

Open source Apache-2.0 Python
19
Stars
1
Forks
0
Issues
2
Watchers
3 months
Last Commit

About langformers

🚀 Unified NLP Pipelines for Language Models

Platforms

Web Self-hosted

Languages

Python

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.