Skip to main content

Scikit-Ollama: an extension of Scikit-LLM for Ollama served models.

Project description

Scikit-Ollama: an extension of Scikit-LLM for Ollama served models.

Leverage the power of Scikit-LLM and the security of self-hosted LLMs.

Installation

pip install scikit-ollama

Support us

You can support the project in the following ways:

  • Support the original Scikit-LLM package. New features will be made available downstream slowly but surely.
  • Star this repository.
  • Provide feedback in the issues section.
  • Share this repository with others.

Quick start & documentation

Assuming you have installed and configured Ollama to run on your machine:

from skllm.datasets import get_classification_dataset
from skollama.models.ollama.classification.zero_shot import ZeroShotOllamaClassifier

X, y = get_classification_dataset()

clf = ZeroShotOllamaClassifier(model="llama3:8b")
clf.fit(X, y)
preds = clf.predict(X)

For more information please refer to the documentation.

Why Scikit-Ollama?

Scikit-Ollama lets you use locally run models for several text classification approaches. Running models locally can be beneficial for cases where data privacy and control are paramount. This also makes you less dependent on 3rd-party APIs and gives you more control over when you want to add changes.

This project builds heavily on Scikit-LLM and has it as a core dependency. Scikit-LLM provides broad and great support to query a variety of backend families, e.g. OpenAI, Vertex, GPT4All. In their version you could already use the OpenAI compatible v1 API backend to query locally run models. However, the issue is that Ollama does not support passing options, such as the context size to that endpoint.

Therefore this model uses the Ollama Python SDK to allow that level of control.

Contributing

For a guide to contributing please follow the steps here.

Citation

@software{Scikit-Ollama,
    author = {Andreas Karasenko},
    year = {2024},
    title = {Scikit-Ollama: an extension of Scikit-LLM for Ollama served models},
    url = {https://github.com/AndreasKarasenko/scikit-ollama}
}

If you consider citing this repository, please also consider citing scikit-llm.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_ollama-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

scikit_ollama-0.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file scikit_ollama-0.2.0.tar.gz.

File metadata

  • Download URL: scikit_ollama-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for scikit_ollama-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d545d4a13f63d554921f4f42273fbabefff379fbd2456857325356f9792e6c6
MD5 df58e83d0564609063419f4585b63241
BLAKE2b-256 a0d671e438637959ca298bfe6e7e591309d120eaf6e67126d109df9b6a155b5e

See more details on using hashes here.

File details

Details for the file scikit_ollama-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scikit_ollama-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8edf901ad382520e0a66b5d03edc2a1ed134ad2fc31e6e7f0a13096450f6378
MD5 88db3bbaccc906b8c8a82d86b1d7d394
BLAKE2b-256 5ca37045e44bca1638e6b42fcc7edca24e815f9af0c8305d4146f412ab16d99a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page