Skip to main content

A JupyterLab extension that provides LiteLLM model abstraction

Project description

jupyter_ai_litellm

Github Actions Status

A JupyterLab extension that provides LiteLLM model abstraction for Jupyter AI

This extension is composed of a Python package named jupyter_ai_litellm that exposes LiteLLM's extensive catalog of language models through a standardized API.

Features

  • Comprehensive Model Support: Access to hundreds of chat and embedding models from various providers (OpenAI, Anthropic, Google, Cohere, Azure, AWS, and more) through LiteLLM's unified interface
  • Standardized API: Consistent REST API endpoints for model discovery and interaction
  • Easy Integration: Seamlessly integrates with Jupyter AI to expand available model options

API Endpoints

Chat Models

  • GET /api/ai/models/chat - Returns a list of all available chat models

The response includes model IDs in LiteLLM format (e.g., openai/gpt-4, anthropic/claude-3-sonnet, etc.)

Model Lists

The extension automatically discovers and categorizes models from LiteLLM's supported providers:

  • Chat models for conversational AI
  • Embedding models for vector representations

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

pip install jupyter_ai_litellm

Uninstall

To remove the extension, execute:

pip uninstall jupyter_ai_litellm

Troubleshoot

If you are seeing the frontend extension, but it is not working, check that the server extension is enabled:

jupyter server extension list

Contributing

Development install

# Clone the repo to your local environment
# Change directory to the jupyter_ai_litellm directory
# Install package in development mode
pip install -e ".[test]"

# Server extension must be manually installed in develop mode
jupyter server extension enable jupyter_ai_litellm

Development uninstall

# Server extension must be manually disabled in develop mode
jupyter server extension disable jupyter_ai_litellm
pip uninstall jupyter_ai_litellm

Testing the extension

Server tests

This extension is using Pytest for Python code testing.

Install test dependencies (needed only once):

pip install -e ".[test]"

To execute them, run:

pytest -vv -r ap --cov jupyter_ai_litellm

Packaging the extension

See RELEASE

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

jupyter_ai_litellm-0.0.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

jupyter_ai_litellm-0.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_ai_litellm-0.0.2.tar.gz.

File metadata

  • Download URL: jupyter_ai_litellm-0.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for jupyter_ai_litellm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 99a4ecb46026a6ee0bcea34b969d1703823224cb0c1a8b1f64891cf3208233f8
MD5 464fadc8d0682d971c240938e205b9c4
BLAKE2b-256 9775478129de888e43403a30350cf83819182d7bc3721bc1729f7d129986d04e

See more details on using hashes here.

File details

Details for the file jupyter_ai_litellm-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_ai_litellm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f1bf0d6531db434f23bcd26969cbae90c965e2d119f11b28ac6a154f65687f57
MD5 381d78e1eaef7746b857deecaf5ca035
BLAKE2b-256 27c65d6a2463ff1883a9fec5489fe17cb9f774ea747fd93df53c75786f82b9dd

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