whatisgithub

What is predikit?

tejas-ta/predikit — explained in plain English

Analysis updated 2026-05-18

30PythonAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A Python library that wraps a trained machine learning model so AI agents like ChatGPT or LangChain can call it as a tool.

Mindmap

mindmap
  root((predikit))
    What it does
      Wraps ML models as agent tools
      Auto-generates input schema
      Routes agent calls to model
    Tech stack
      Python
      Pydantic
      scikit-learn
      LangChain
    Use cases
      Export model as OpenAI tool
      Export model as LangChain tool
      Group models in a registry
    Audience
      ML engineers
      Agent developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn a trained scikit-learn or XGBoost model into an OpenAI function-calling tool.

USE CASE 2

Export a model as a LangChain tool with one line of code.

USE CASE 3

Set confidence thresholds so uncertain predictions get flagged or rejected.

USE CASE 4

Combine several models into an ensemble that votes or averages predictions.

What is it built with?

PythonPydanticscikit-learnXGBoostLangChain

How does it compare?

tejas-ta/predikitchandar-lab/semantic-wmdjlougen/hive
Stars303030
LanguagePythonPythonPython
Setup difficultyeasyhardeasy
Complexity2/55/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Field names in your Pydantic schema must exactly match the model's trained column names.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

predikit is a Python library that wraps a trained machine learning model so that an AI agent or language model can call it as a tool. The problem it solves is that ML models (built with libraries like scikit-learn or XGBoost) and AI agents (built with tools like OpenAI's API or LangChain) use different conventions for defining inputs and outputs. predikit bridges that gap by automatically generating the schema description an AI agent needs to know what to send, then routing the agent's input to the model and returning the prediction. The core object is called ModelTool. You give it a fitted model, a name, a description, and a Pydantic schema describing the input fields. From there you can export it as an OpenAI function-calling schema, a LangChain tool, or a plain Python callable, with one line each. When invoked, it validates the input, calls the model's predict method, and returns the result as a dictionary. If you have multiple models, a ToolRegistry lets you group them and export all at once. The library includes a few practical extras. A confidence threshold feature lets classifiers flag or reject predictions when the model is uncertain, with options to log a warning, raise an error, or hand off to a fallback tool. An ensemble wrapper lets you run several models and combine their predictions by averaging, majority vote, or merging outputs. Loaders for MLflow and Snowflake model registries let you pull a registered model directly without writing loading code yourself. The library also handles a common quirk where language models return strings like "yes" or "true" for boolean fields, coercing those to proper Python booleans before validation. Field names in the Pydantic schema must exactly match the column names the model was trained on, predikit maps inputs by name, not position, and reports clearly which names are mismatched if there is a conflict. The package is MIT licensed and available on PyPI.

Copy-paste prompts

Prompt 1
Help me wrap my trained scikit-learn model with predikit's ModelTool.
Prompt 2
Show me how to export a predikit model as a LangChain tool.
Prompt 3
Explain how to set up a confidence threshold and fallback tool in predikit.
Prompt 4
Walk me through loading a model from MLflow using predikit's loaders.

Frequently asked questions

What is predikit?

A Python library that wraps a trained machine learning model so AI agents like ChatGPT or LangChain can call it as a tool.

What language is predikit written in?

Mainly Python. The stack also includes Python, Pydantic, scikit-learn.

What license does predikit use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is predikit to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is predikit for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.