LangSchema is an Elixir library that helps developers create provider-agnostic schemas for AI model integration. It abstracts away the differences between various AI providers, making it easier to switch between them without modifying your core schema definitions.
Key Features
- Abstract Schema: Provides a flexible, unified schema format that can be converted to provider-specific JSON schemas.
- Extensible Converters: Easily add support for new AI providers by implementing the LangSchema.Converter behaviour.
- Direct Integration: Compatible with Elixir LangChain, allowing seamless integration without extensive modification.
Why Use LangSchema?
As the AI landscape rapidly evolves, developers often need to switch between different providers like OpenAI, Gemini, or emerging alternatives. However, each provider has its own JSON schema requirements, making it cumbersome to adjust schemas every time you switch models. LangSchema addresses this by introducing an intermediate, provider-agnostic schema format, allowing you to define your data structures once and reuse them across different providers with minimal modification. This not only simplifies your code but also significantly reduces the friction when experimenting with or integrating new AI models.
Moreover, LangSchema is designed with extensibility in mind. You can easily create custom converters to handle provider-specific quirks or special requirements, ensuring that your schema can evolve alongside the rapidly changing AI ecosystem. This flexibility makes it an ideal choice for developers who need full control over their schema definitions.
Built-in Supported Converters
- OpenAI
- Gemini
For more information, check out the repository: