Practical overview
When it fits
Use Scikit LLM when you want to incorporate a GPT classifier into a Python text-analysis workflow using a scikit-learn-style interface.
Who it is for
- Python developers using scikit-learn who want to add LLM-based text classification.
- Practitioners exploring sentiment labels or other zero-shot categories on text datasets.
Documented uses
- Classify text with a GPT zero-shot classifier.
- Use a familiar fit-and-predict pattern for LLM-backed text analysis.
- Generate sentiment predictions for text labeled positive, negative or neutral in the demonstration.
Requirements & limits
The project is identified as open source under the MIT license. The documented example requires an OpenAI key and organization ID.
- The demonstrated classifier uses OpenAI credentials and names GPT-4 as its model.
- The README provides a pip installation command and a Python example, rather than a hosted interface.
- The repository identifies Python as its primary language and lists scikit-learn and OpenAI in the project ecosystem.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run zero-shot text classification with GPT
Use Scikit-LLM’s GPT classifier on its demo text-classification dataset.
Before you start
- Python environment with Scikit-LLM installed (
pip install scikit-llm). - OpenAI API key and organization ID.
- The example uses the
gpt-4model.
Steps
Install Scikit-LLM with the command below.
pip install scikit-llmImport
get_classification_dataset,SKLLMConfig, andZeroShotGPTClassifierfrom the modules shown in the README.Set credentials with
SKLLMConfig.set_openai_key("")andSKLLMConfig.set_openai_org("").Load the demo data with
X, y = get_classification_dataset(), createZeroShotGPTClassifier(model="gpt-4"), then callclf.fit(X, y)andclf.predict(X).
Expected outcome
The example invokes a GPT zero-shot classifier to predict labels for the demo text dataset, whose labels are positive, negative, and neutral.
Guide limitations
- The example requires OpenAI credentials and selects
gpt-4.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 10 October 2026
- Original website title
- fnnx-ai/scikit-llm · Official homepage title · retained in its source language

