Skip to main content

Pydantic AI Kernel

This is wrapper around pydantic-ai agent, that allows to request it through jupyter kernel messaging protocol.

We support :

  • streaming output,
  • multi-type output (markdown, raw text), and soon : images, audio, jupyter widgets
  • API's for accessing the agent :
    • classical ZeroMQ jupyter kernel API
    • web socket API, with jupyter kernel gateway
  • user-approval (human in the loop) with input_request messages
  • any pydantic-ai agent can be wrapped in this kernel
  • basic configuration through metakernel magics (agent history, tool list, mcp server, output formatter, ...)

Documentation : https://mariusgarenaux.github.io/pydantic-ai-kernel

Getting started

Within a python venv,

pip install pydantic-ai-kernel

Any jupyter frontend should be able to dialog with this kernel, for example :

• CLI : Install jupyter-console (pip install jupyter-console); and run jupyter console --kernel pydantic_ai

• Notebook (you might need to restart the IDE) : select 'pydantic_ai' on top right of the notebook

• Jupyter Lab : see [Jupyter Lab]

• jpterm : a fancy jupyter lab interface, in the terminal ! https://davidbrochart.github.io/jpterm/

• euporie : a fancy kernel frontend : https://euporie.readthedocs.io/en/latest/pages/installation.html

• Silik Signal Messaging : Access the kernel through Signal Message Application, see here

For example :

jupyter console --kernel pydantic_ai

In the kernel, send :

%config

to create the config file, and start chat. See documentation for more informations.

%help <magic_name> and %magic will give you appropriate documentation

Troubleshooting

TAB completion for magic can be broken with older metakernel versions (before 1.0.4). To fix it, install the 1.0.4 manually :

uv add "metakernel @ git+https://github.com/Calysto/metakernel.git@afd3ddd"

or without uv:

git clone https://github.com/Calysto/metakernel
cd metakernel
git checkout afd3ddd
pip install -e .
cd ..

Metadata

Release files for pydantic-ai-kernel 1.5.2

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

Source distribution (sdist)

Source distribution for pydantic-ai-kernel 1.5.2
File Size Uploaded
pydantic_ai_kernel-1.5.2.tar.gz 27.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-kernel 1.5.2
File Interpreter ABI Platform
pydantic_ai_kernel-1.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 67.3 kB

Release files / pydantic_ai_kernel-1.5.2.tar.gz

Download URL pydantic_ai_kernel-1.5.2.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8ea8ddfc7b0e4864e5769343847e61ba7912f64025a547d5ccdb5ea5f6593e98
BLAKE2b-256 checksum
How to use checksums
5fae3e31dd55bdf538d54d36444ea928ca9d747019fa8a0394f133a23b5f8d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.3

Release files / pydantic_ai_kernel-1.5.2-py3-none-any.whl

Download URL pydantic_ai_kernel-1.5.2-py3-none-any.whl
Size 39.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d5af46593b3d98fbfc50a97918b8367f56de9a1fa4e59781d08019814a458e5
BLAKE2b-256 checksum
How to use checksums
dbc03229b6f739f21b371d5704a03eda2f876eb60b5dd835d6df0db7e388be1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.3

Release history Release notifications | RSS feed

1.5.4

2 release files

1.5.3

2 release files

This release

1.5.2 This release

2 release files

1.5.1

1 release file

1.5.0

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.10

1 release file

1.3.9

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.11

1 release file

1.2.10

1 release file

1.2.9

1 release file

1.2.8

1 release file

1.2.6

1 release file

1.2.5

1 release file

1.2.4

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1

1 release file

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