Skip to main content

Lightweight LLM provider abstractions and connectors.

Project description

modelito

Lightweight Python library of provider abstractions and connectors for local and cloud LLM runtimes (Ollama, OpenAI, Claude, Gemini). Designed to be dependency-light, test-friendly, and easy to integrate into downstream projects such as BatLLM and mail_summariser.

CI

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.0-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.2.tar.gz (29.5 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.2-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: modelito-0.2.2.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for modelito-0.2.2.tar.gz
Algorithm Hash digest
SHA256 eb625d343bfc8871fbe6b6b59fa728017178d230a0949f871455ea03e91ef8fa
MD5 670dfb86b24d921b57cb9bf8c04d27fd
BLAKE2b-256 ad995b0e5700787c15f2aba5e07aff52d6b86f3b9d74604f667bd33d181aa838

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modelito-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for modelito-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02b6d5a2c5b6f8be9d21834466124fc04be89a6bedcb57e8c502489320f9dfc5
MD5 f8ef04f863221b82f03e50448e32cec8
BLAKE2b-256 0cfb232ce246daf39a027e76a5631ffb10773f1a1d8c924657b6bb3cf408545a

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