Jupyter notebook plugin to generate code with AI
Project description
💫 ncoder
ncoder is an open-source AI coding agent that integrates with Jupyter Notebooks. This project uses the OpenAI API client to connect to any OpenAI-compatible endpoint and enable collaborative coding with AI.
ncoder provides a sandboxed base Docker image that supports coding with OpenCode in server mode, a quantized Qwen3-Coder 30B model for lightweight local inference and/or any other txtai process.
ncoder is designed for Developers, AI Engineers and Data Scientists that spend a lot of their time inside of Jupyter Notebooks. If you do your research and/or prototyping inside of notebooks, this gives you an easy way to pull in new ideas.
Getting Started
ncoder consists of two parts: a sandboxed Docker image with an AI coding agent and a local Jupyter Notebook.
The coding agent can be started using one of the following ways.
# DEFAULT: Run with opencode backend, sends data to `opencode serve` endpoint
docker run -p 8000:8000 --gpus all --rm -it neuml/ncoder
# ALTERNATIVE 1: Run with qwen3-coder, keeps all data local
docker run -p 8000:8000 -e CONFIG=qwen3-coder.yml -gpus all --rm -it neuml/ncoder
# ALTERNATIVE 2: Run with a custom txtai workflow
docker run -p 8000:8000 -v config:/config -e CONFIG=/config/config.yml \
--gpus all --rm -it neuml/ncoder
Running in a sandboxed environment decouples AI coding from your local working environment. Running in isolation provides assurance that it won’t modify your workspace directly.
Next, install the Jupyter Notebook extension on your local machine.
pip install ncoder
Jupyter Notebooks can be created in Visual Studio Code or your preferred notebook platform. Add the following two sections to test.
# Load ncoder extension
%load_ext ncoder
# Test it out
%ncoder Write a Python Hello World Example
An example notebook is also available.
The ncoder Jupyter Notebook extension works with any LLM API that has OpenAI API compatibility. It’s simply a matter of setting the correct environment variables.
%env OPENAI_BASE_URL=LLM API URL (e.g. https://api.openai.com/v1)
%env OPENAI_API_KEY=api-key
%env API_MODEL=gpt-5.2
%load_ext ncoder
These same parameters can be used if the sandboxed Docker coding agent is being run using a different configuration (the default url is http://localhost:8000/v1).
Demo
The short video clip below gives a brief overview on how to use ncoder.
Further Reading
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ncoder-0.3.0.tar.gz.
File metadata
- Download URL: ncoder-0.3.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9bc0d05a76a00b43b151d1e427b1a3da4346339925a4ca3d67ed07c7cd8549b
|
|
| MD5 |
97d6a7bc32c0afda14166b67d1631f64
|
|
| BLAKE2b-256 |
316b04b9cc3ef2effd2d19d8c1e62792f7be0f063dc199be929a1d32da075f09
|
File details
Details for the file ncoder-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ncoder-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05f32ba143c672267b69c8124803835628d1c0201d5db3431c62c22d39be6a3d
|
|
| MD5 |
d2aff4180534f51bc01bef266699b1e4
|
|
| BLAKE2b-256 |
de361173d54916cb9acd2cb417e13f4a69c728d6cee1c4a18c23630c598f4714
|