Skip to main content

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

Release files for jupyter-ai-litellm 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-ai-litellm 0.0.3
File Size Uploaded
jupyter_ai_litellm-0.0.3.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-ai-litellm 0.0.3
File Interpreter ABI Platform
jupyter_ai_litellm-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / jupyter_ai_litellm-0.0.3.tar.gz

Download URL jupyter_ai_litellm-0.0.3.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
389739d66e92c93a92f8ca46fa5ece752f1b332ca60a152d6dc96ef51ba41aef
BLAKE2b-256 checksum
How to use checksums
75a9fadb96c83dc74ade7f013dd5d2345ee9289763136ced5ee4aa323a003c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / jupyter_ai_litellm-0.0.3-py3-none-any.whl

Download URL jupyter_ai_litellm-0.0.3-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dfd0a8ec744457cd940c5b5e5d5541d67c00fef3a6aa192ce674eb9f3fa9bed
BLAKE2b-256 checksum
How to use checksums
179cbfa4bc68fb38a44afa30660b4c65160d6e3bf0f074b5b274369b635c6b15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.1.0

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page