Skip to main content

kernmini

Everything a Jupyter kernel needs except the language.

kernmini is a Rust engine for Jupyter kernels. It owns ZMTP transport, signed Jupyter messages, shell and control routing, IOPub, stdin, heartbeat, execution queues, interrupts, JEP 91 subshells, debugging transport, and process lifecycle. A language supplies execution, completion, inspection, history, and kernel metadata through a small adapter.

ipymini is the reference Python kernel. It uses IPython for Python semantics and kernmini for the kernel protocol.

A complete Python kernel

import sys
from kernmini import run_kernel


class EchoShell:
    def __init__(self):
        self.stream = None

    def set_stream_sender(self, sender): self.stream = sender

    def kernel_info(self):
        return dict(implementation="echo", implementation_version="0.1", banner="echo",
            language_info=dict(name="echo", version="0.1", mimetype="text/plain", file_extension=".txt"))

    async def execute(self, code, **kwargs):
        if self.stream: self.stream("stdout", f"echo: {code}\n")
        return dict(result={"text/plain": code.upper()})


run_kernel(sys.argv[-1], EchoShell, own_process_group=True)

run_kernel creates a persistent asyncio event loop and runs the Rust engine until shutdown. It uses loopmini when installed and the standard asyncio loop otherwise; loop_factory= can select one explicitly. The shell factory can be synchronous or asynchronous, and initialization completes before serving requests. The factory is also used to create independent language sessions for JEP 91 subshells. Standalone executables can request process-group ownership, while embedded kernels leave their host process group unchanged by default.

A shell runs synchronous user code inside with kernmini.user_code():. An interrupt raises KeyboardInterrupt inside the block. Outside it, an interrupt cancels the execution's task at its next await.

Rust language implementations use the Language and LanguageSession traits directly. A session with no subshells is a Language by itself. run_kernel_blocking serves one from a program with no Tokio runtime. ExecutionContext provides stream, display, stdin, interrupt, and subshell routing without exposing Jupyter transport details. kernmini keeps each session's execution count, and the context gives each execution its count.

A language can also implement kernmini's kernel operations: execute requests that ask for tool schemas, a tool call or expression values without sending source code. DEV.md specifies them.

Operations return kernmini::Result<T> with a typed ErrorKind and preserved causes. These operational failures are separate from an executed program's LanguageError. See the error contract for cancellation, closure, timeout, and Python exception mappings.

ThreadWorker lets async adapters call a synchronous interpreter on a dedicated thread. Its factory creates the interpreter there and call awaits a closure's result. Rust interpreters need not be Send; adapters supply a thread builder for its name and stack size, and shutdown waits for destruction on the same thread. Python uses await ThreadWorker.start(factory, stack_size=...), await worker.call(callback) and await worker.shutdown(); shutdown releases the worker's interpreter reference there. Python shells may supply interrupt() to signal a native interpreter from a thread of its own, and shutdown() to explicitly free native resources through worker.call(...) before shutting down the worker. Language traits stay async.

Output queues are bounded and apply backpressure rather than silently dropping messages. The output pump batches adjacent same-stream writes without a timer. A slow direct IOPub subscriber can slow execution.

DapClient is the optional language-neutral debugger transport: framed TCP, request correlation, timeouts, asynchronous events, and shutdown. Language adapters retain debugger startup, request policy, source mapping, and variable semantics.

install_kernelspec(name, argv, display_name, language) and install_kernelspec_dir(path, name) install kernelspecs without requiring jupyter_client.

Install

pip install kernmini

Windows wheels are built for x64 and ARM64 with CPython 3.11–3.14. Windows kernels must set "interrupt_mode": "message" in their kernelspec; the Windows interrupt event used by signal-mode kernels is not supported. Protocol shutdown works, but Windows kernels do not monitor parent death or clean up child processes.

Metadata

Release files for kernmini 0.1.25

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

Source distribution (sdist)

Source distribution for kernmini 0.1.25
File Size Uploaded Provenance Actions
kernmini-0.1.25.tar.gz 52.0 kB With provenance Details for kernmini-0.1.25.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kernmini 0.1.25
File Actions
kernmini-0.1.25-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for kernmini-0.1.25-cp311-abi3-win_arm64.whl
kernmini-0.1.25-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for kernmini-0.1.25-cp311-abi3-win_amd64.whl
kernmini-0.1.25-cp311-abi3-manylinux_2_31_x86_64.whl CPython 3.11 abi3 Linux glibc 2.31+ x86-64 Details for kernmini-0.1.25-cp311-abi3-manylinux_2_31_x86_64.whl
kernmini-0.1.25-cp311-abi3-manylinux_2_31_aarch64.whl CPython 3.11 abi3 Linux glibc 2.31+ ARM64 Details for kernmini-0.1.25-cp311-abi3-manylinux_2_31_aarch64.whl
kernmini-0.1.25-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for kernmini-0.1.25-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 7.1 MB

Release files / kernmini-0.1.25.tar.gz

Download URL kernmini-0.1.25.tar.gz
Size 52.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ea7576b57c57ff9ffd5b99b5a3fa8f336b46813d5a1c23334e264bb8016bd8b7
BLAKE2b-256 checksum
How to use checksums
d8342f41e7ec4c142da25ba8d793ad853b2317d1bd4161c560e4f0a85b5f572c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kernmini-0.1.25-cp311-abi3-win_arm64.whl

Download URL kernmini-0.1.25-cp311-abi3-win_arm64.whl
Size 1.3 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
d2e76bd22757ce5804483d3a7b9ae81d6b850b04520b076167744cc7443ba0a8
BLAKE2b-256 checksum
How to use checksums
3cc8c78a52e02513f2aff6bb1fe80c2bdd5cf3991878f28cd117523dc884c777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kernmini-0.1.25-cp311-abi3-win_amd64.whl

Download URL kernmini-0.1.25-cp311-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
79da7e4a3e50a2117d234c49685033bef3912d0092db5f561f0bf520ea2b75c5
BLAKE2b-256 checksum
How to use checksums
f81907c68d9c0efe01269cda38775abbca8bdd694b1b22cc8c6bd121879d3db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kernmini-0.1.25-cp311-abi3-manylinux_2_31_x86_64.whl

Download URL kernmini-0.1.25-cp311-abi3-manylinux_2_31_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.31+ x86-64 abi3
SHA-256 checksum
How to use checksums
b3d1e0bf7961955189923d6c9251dd9a673a45cd8ce2935ddb2b3a92375f5718
BLAKE2b-256 checksum
How to use checksums
ba6dd7e1af1f5c0759ef7480a79e75f357b3fe52006962514e84ba3bce849958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kernmini-0.1.25-cp311-abi3-manylinux_2_31_aarch64.whl

Download URL kernmini-0.1.25-cp311-abi3-manylinux_2_31_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.31+ ARM64 abi3
SHA-256 checksum
How to use checksums
5a5bcca2f3255cac52c4aac0b101849b73271b6c09a6423d7643f2d57b835b3c
BLAKE2b-256 checksum
How to use checksums
8410a669342ee8afc8342a054f1bbe240a72bf60393056a8a03ffbda35b2a8ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kernmini-0.1.25-cp311-abi3-macosx_11_0_arm64.whl

Download URL kernmini-0.1.25-cp311-abi3-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
304c77e66bed0c44a3fbe077730640a6820f2055451f43181683ec9c731b9494
BLAKE2b-256 checksum
How to use checksums
02c5148aea28b6e6194d6fc42efe4bac6f86fe0c076f65dbed4d633c4ea07d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for kernmini 0.1.25

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for kernmini-0.1.25.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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