Skip to main content

When to extend

The built-in providers cover the most common cases. Build a custom adapter when you need:
  • A different LLM not yet supported (e.g., a private model, Azure OpenAI)
  • A different vector database (e.g., Weaviate, Qdrant, Chroma)
  • A different reranker
  • Custom pre/post processing in any adapter layer

Custom LLM provider

LangChat’s engine expects an LLM that implements invoke() and ainvoke() methods returning an object with a .content attribute.

Azure OpenAI example


Custom vector database

LangChat’s engine calls vector_adapter.get_retriever() to get a LangChain retriever. Any LangChain-compatible vector store retriever works.

Custom database adapter

LangChat calls db.client to get the Supabase client. For a different database backend, implement the same interface.

Contributing a new provider

If your adapter could benefit other users, consider contributing it to LangChat:
  1. Add the adapter in src/langchat/adapters/<category>/
  2. Add the provider wrapper in src/langchat/providers/__init__.py
  3. Add tests in tests/adapters/<category>/
  4. Update the documentation in docs/adapters/
  5. Open a PR on GitHub
See CONTRIBUTING.md for the full contribution guide.