Skip to main content

Lightweight Python abstractions and connectors for LLM providers (OpenAI, Claude, Gemini, Ollama).

Project description

modelito

Modelito is a compact, dependency-light Python library that provides provider- agnostic abstractions and connectors for large language models (LLMs). It offers lightweight shims for OpenAI, Claude, Gemini and local Ollama deployments, plus utilities for token counting, timeout estimation, and small helpers to manage Ollama servers when needed. The library is designed for easy integration into applications and CI pipelines.

Quick start

Install in editable mode for development (install optional extras as needed):

pip install -e .[dev]
pip install -r dev-requirements.txt

# Optional extras
pip install -e .[ollama,tokenization,openai,anthropic]

Run tests:

pytest -q

Build and install

To build a source distribution and wheel locally:

python -m pip install --upgrade build
python -m build

Install from the built wheel:

pip install dist/modelito-0.2.3-py3-none-any.whl

See the docs/ folder for more details on calibration and migration.

Providers

This package provides compatibility shims and small, dependency-light implementations for common provider interfaces. When optional extras are installed the package will attempt to use real SDK clients; otherwise the shims provide safe offline-friendly fallbacks suitable for testing.

Provided shims and utilities:

  • OllamaProvider — HTTP-aware provider that will call a local Ollama HTTP API when available. If the HTTP API is unavailable the provider will attempt to use the local Ollama CLI as a best-effort fallback before returning a deterministic stub useful for tests and examples.
  • GeminiProvider, GrokProvider — lightweight shims.
  • OpenAIProvider, ClaudeProvider — will use the official SDKs when installed, falling back to deterministic behavior otherwise.

License / AS IS

This software is provided "AS IS" and without warranties of any kind. See the included LICENSE file for the full MIT license text.

CI / Integration Tests

This repository includes a GitHub Actions workflow at .github/workflows/ci.yml. The workflow runs mypy and the unit test suite on push and pull requests.

Ollama integration tests are intentionally gated and will only run when you explicitly enable them. To run integration tests locally or in CI set the environment variable RUN_OLLAMA_INTEGRATION=1. Additional optional flags:

  • ALLOW_OLLAMA_INSTALL=1 — permit the integration tests to attempt installing Ollama when missing.
  • ALLOW_OLLAMA_DOWNLOAD=1 — permit downloading remote models during integration tests.
  • ALLOW_OLLAMA_UPDATE=1 — permit running update flows during integration tests.

Example (local):

RUN_OLLAMA_INTEGRATION=1 pytest tests/test_ollama_integration.py -q

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

modelito-0.2.3.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelito-0.2.3-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file modelito-0.2.3.tar.gz.

File metadata

  • Download URL: modelito-0.2.3.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for modelito-0.2.3.tar.gz
Algorithm Hash digest
SHA256 fc47bde5fff480d3eaa1a3db47ffb97d538a1a653df6f37cdb4c3ffe3ccb03d5
MD5 5d2ffbb98231134f2982b7a415be47e4
BLAKE2b-256 719f7684e9f9d06d6221344a95cad280542c33f20c682d7d0e993dfc2a268fd4

See more details on using hashes here.

File details

Details for the file modelito-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: modelito-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for modelito-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 669899a2acae00ef1b82190e3220e85e15aea53f5bbc46cf03a78dc4d3ecb72b
MD5 ba8be72db0837b31175b3de6e549ef70
BLAKE2b-256 76caa7a7d7a1609c1dda17c98a6f5a06904a999557499ce9b452d36689eea2ea

See more details on using hashes here.

Supported by

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