Tejas-TA/predikit
The missing bridge between your ML models and your AI agents.
What it solves
predikit eliminates the tedious glue code required to make traditional machine learning models (like those from scikit-learn or XGBoost) callable by LLM agents. It automates the creation of JSON schemas, ensures type safety for inputs, and provides a standardized way to integrate these models as tools within agentic workflows.
How it works
The library wraps trained ML models in a ModelTool object. By defining a Pydantic BaseModel for the input schema, predikit automatically generates the necessary JSON schemas for LLM APIs (such as OpenAI's function calling) and validates the data passed from the LLM to the model. It also includes a ToolRegistry for managing multiple tools and a ModelEnsemble class to combine predictions from multiple models using strategies like voting or averaging.
Who it’s for
Developers and ML engineers who want to integrate predictive ML models into LLM-powered agents or applications without writing manual validation and schema boilerplate.
Highlights
- Auto-generated Schemas: One-line export to OpenAI function-calling or LangChain
StructuredToolformats. - Type-Safe I/O: Uses Pydantic v2 for strict input validation and automatic coercion of LLM-generated strings (e.g., "yes" to
True). - Model Ensembling: Built-in strategies for aggregating multiple model outputs via mean, vote, or weighted variants.
- Confidence Routing: Ability to warn, raise errors, or trigger a fallback tool when a classifier's prediction confidence falls below a specified threshold.
- Registry Loaders: Direct integration with MLflow and Snowflake Model Registries to load models without manual boilerplate.
- Async Support: Provides
ainvoke()for non-blocking inference.