Skip to main content

No project description provided

Project description

Jupyter package

This package provides a custom Jupyter kernel that allows extra communication beyond the usual Jupyter message types to allow for the kernel to interact with an LLM (GPT-4) and answer questions and generate code that is runnable in native notebook code cells.

This package contains 4 different products:

  • A Python module named beaker_kernel (pyproject.toml)
  • A Jupyter kernel (beaker)
  • A Jupyter service (main.py)
  • A standalone development interface (dev_ui)

Install / setup

beaker_kernel Python module

Normal installation:

# Requires [hatch](https://github.com/pypa/hatch)
$ pip install hatch  # If needed
$ pip install .

Development installation

$ pip install -e .

Jupyter kernel

The Beaker Kernel should be automatically installed if Beaker is installed using the method above.

If the kernel is not installed, or you want to install the kernel manually ensure that the beaker_kernel package is accessible in your environmnet and then simply copy or symlink the kernel.json file to one of the directories defined in the following document inside a unique directory:

https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs

For example:

$ cp -r beaker_kernel/kernel.json /usr/share/jupyter/kernels/beaker/kernel.json

Once the directory exists and the jupyter service is restarted the kernel should be available for selection.

Dev setup

This package is bundled with a basic development UI for development and testing.

You will need to update the .env file with your OpenAI/GPT API key to use the LLM.

Once you have set up the environment and added your keys you can start the dev server by running:

$ make dev

This will start the Jupyter service and launch a specialized notebook interface in your browser similar to if you ran $ jupyter notebook normally.

Differences from vanilla Jupyter

This setup uses mostly stock Jupyter services as provided in the Jupyter Python packages, with minor differences.

The entry point of the docker file runs the file main.py which starts a JupyterLab Server App. The key differences here are:

  1. This service does not run any front-end outside of dev mode and only provides API and websocket access as this service is expected to connect to a custom interface.
  2. Some security settings are loosened to allow access through the a custom interface and allow Beaker to access the Jupyter service API to manage subkernels:
    1. allow_orgin rule loosened as UI and Kernel likely do not share the same domain.
    2. disable_check_xsrf set so as the Jupyter API does not require xsrf checks, allowing Beaker to make calls directly

These security settings will be reviewed in the future in an attempt to tighten the modifications.

More information can be found in the official docs (link coming soon).

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

beaker_kernel-1.2.2.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

beaker_kernel-1.2.2-py3-none-any.whl (5.7 MB view details)

Uploaded Python 3

File details

Details for the file beaker_kernel-1.2.2.tar.gz.

File metadata

  • Download URL: beaker_kernel-1.2.2.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.2

File hashes

Hashes for beaker_kernel-1.2.2.tar.gz
Algorithm Hash digest
SHA256 3c099a12897362040bbb27c3c6df5101dec2a088d08aa8ec7f37fb7452c1b5e1
MD5 85dd6649df0cfd44f0668a8d6f116fde
BLAKE2b-256 8afd6e04b430b0f4bcbdb4cd5eface385972208e67cbeffb9be12941f61e2794

See more details on using hashes here.

File details

Details for the file beaker_kernel-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for beaker_kernel-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33b19f2247f1fee5cf4f3a6ea8201ae7d3f045741f58120be74f3edb0267218d
MD5 e6951c279f27c9f2efe74812f44b9614
BLAKE2b-256 4c0e51ee6abb98ff3c0284061c9a7c72589f5130de984cf845ac49ea0200812c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page