MCPcopy Index your code
hub / github.com/BeastByteAI/scikit-llm

github.com/BeastByteAI/scikit-llm @v1.4.3

repository ↗ · DeepWiki ↗ · release v1.4.3 ↗ · Ask this repo → · + Follow
293 symbols 990 edges 68 files 148 documented · 51% updated 4d agov1.4.3 · 2026-01-21★ 3,52511 open issues
README

logo

Scikit-LLM: Scikit-Learn Meets Large Language Models

Seamlessly integrate powerful language models like ChatGPT into scikit-learn for enhanced text analysis tasks.

Installation 💾

pip install scikit-llm

Support us 🤝

You can support the project in the following ways:

  • ⭐ Star Scikit-LLM on GitHub (click the star button in the top right corner)
  • 💡 Provide your feedback or propose ideas in the issues section or Discord
  • 📰 Post about Scikit-LLM on LinkedIn or other platforms
  • 🔗 Check out our other projects: Dingo, Falcon

Logo

Logo

Quick Start & Documentation 📚

Quick start example of zero-shot text classification using GPT:

# Import the necessary modules
from skllm.datasets import get_classification_dataset
from skllm.config import SKLLMConfig
from skllm.models.gpt.classification.zero_shot import ZeroShotGPTClassifier

# Configure the credentials
SKLLMConfig.set_openai_key("<YOUR_KEY>")
SKLLMConfig.set_openai_org("<YOUR_ORGANIZATION_ID>")

# Load a demo dataset
X, y = get_classification_dataset() # labels: positive, negative, neutral

# Initialize the model and make the predictions
clf = ZeroShotGPTClassifier(model="gpt-4")
clf.fit(X,y)
clf.predict(X)

For more information please refer to the documentation.

Citation

You can cite Scikit-LLM using the following BibTeX:

@software{ScikitLLM,
  author = {Iryna Kondrashchenko and Oleh Kostromin},
  year = {2023},
  publisher = {beastbyte.ai},
  address = {Linz, Austria},
  title = {Scikit-LLM: Scikit-Learn Meets Large Language Models},
  url = {https://github.com/iryna-kondr/scikit-llm }
}

Core symbols most depended-on inside this repo

_set_keys
called by 27
skllm/llm/gpt/mixin.py
get
called by 19
skllm/llm/gpt/clients/llama_cpp/handler.py
_get_chat_completion
called by 7
skllm/llm/base.py
_set_hyperparameters
called by 5
skllm/llm/base.py
construct_message
called by 5
skllm/llm/gpt/mixin.py
transform
called by 5
skllm/models/_base/tagger.py
_get_openai_key
called by 4
skllm/llm/gpt/mixin.py
_get_openai_org
called by 4
skllm/llm/gpt/mixin.py

Shape

Method 163
Class 76
Function 48
Route 6

Languages

Python100%

Modules by API surface

skllm/models/_base/classifier.py35 symbols
skllm/config.py23 symbols
skllm/models/_base/text2text.py17 symbols
skllm/llm/gpt/mixin.py17 symbols
skllm/llm/vertex/mixin.py12 symbols
skllm/models/_base/tagger.py11 symbols
tests/llm/gpt/test_gpt_mixins.py10 symbols
skllm/llm/base.py10 symbols
skllm/llm/gpt/clients/llama_cpp/handler.py9 symbols
tests/llm/anthropic/test_anthropic_mixins.py8 symbols
skllm/prompts/builders.py8 symbols
skllm/llm/anthropic/mixin.py8 symbols

For agents

$ claude mcp add scikit-llm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact