Providing entry points

To provide entry points, your custom Python package must use a pyproject.toml manifest. To provide an existing class as an entry point, fill out the following template and add it to the end of your package’s pyproject.toml file.

[project.entry-points.<entry-point-group>]
<some-unique-name> = "<module-path>:<class-name>"

where:

  • <entry-point-group> takes the name of an entry point group used by Jupyter AI, e.g. 'jupyter_ai.personas'. Make sure <entry-point-group> is surrounded by single or double quotes. For example, the Claude Code persona set up is as follows:

    [project.entry-points."jupyter_ai.personas"]
    claude_code = "jupyter_ai_claude_code.persona:ClaudeCodePersona"
  • <some-unique-name> can be any string, as long as it is unique within each [projects.entry-points.*] table.

  • <module-path> takes the path to your module containing the class.

    • For example, if you are providing a persona defined in my_custom_package/personas/custom.py, then this field should be set to my_custom_package.personas.custom.

  • <class-name> takes the name of the class defined in <module-path>.

Finally, for Jupyter AI to read from your package’s entry points, your package must be installed in the same Python environment. Entry points are only read by Jupyter AI when the server starts, so you should also restart JupyterLab after installing your custom package to see the new changes.

Note

After adding/removing an entry point, you will also need to re-install the package & restart JupyterLab for the changes to take effect.