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.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 pydantic-ai-kernel 1.5.3
File Size Uploaded
pydantic_ai_kernel-1.5.3.tar.gz 28.0 kB Details

Built distribution (wheel)

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

Total release size: 67.7 kB

Release files / pydantic_ai_kernel-1.5.3.tar.gz

Download URL pydantic_ai_kernel-1.5.3.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
15251ad2ff0567c6ba7cce9f6fdefb5e4a4af67b28ff1e4b07acb8ce6d75725b
BLAKE2b-256 checksum
How to use checksums
9989b46099ea6515abe13c2c81fb379a09212363f0b5e6bde385bbff42a6c199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.3

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

Download URL pydantic_ai_kernel-1.5.3-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c899fb0c6d8a79833d20fb0b316cefefcfbeb683ee646b632d92629e249363e
BLAKE2b-256 checksum
How to use checksums
77eb14a76927c9a3f8a7a6eacd2fefbd308c7dd0998950d78f9be00f14b35605
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

This release

1.5.3 This release

2 release files

1.5.2

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