Environments
An environment is a container image built once from a recipe you choose:
pip packages on a platform base, a conda environment.yml, or your own
Dockerfile. Every runtime you launch on it reuses that image. You pick it in
the runtime bar under Environment, and the Environments page is where
you build, edit and share them.
Templates
The platform ships pinned, ready-to-launch templates. You do not have to build anything to start.
| Template | Base | What is in it |
|---|---|---|
| Blank | Slim (CPU) | Python and the notebook kernel, nothing else. |
| Data Science | Slim (CPU) | NumPy, pandas, scikit-learn, Matplotlib. |
| PyTorch + CUDA | CUDA (GPU) | PyTorch and torchvision. |
| HuggingFace NLP | CUDA (GPU) | Transformers, Datasets and Accelerate. |
| Computer Vision | CUDA (GPU) | PyTorch, torchvision, OpenCV and Pillow. |
| JAX + Flax | CUDA (GPU) | JAX with Flax and Optax. |
| Reinforcement Learning | CUDA (GPU) | Gymnasium and Stable-Baselines3 on PyTorch. |
Templates are fully pinned, so a launch today and a launch next month run the same versions. Templates cannot be edited in place: Duplicate one to get your own copy to change.
Provider default environment
Where the platform offers it, the Environment picker in Runtime settings starts with Provider default environment: the cloud's own stock machine image, with no environment image at all. Neural Studio installs its platform layer onto that image while the runtime boots, so the notebook, the terminal, SSH, the workspace mount and the SDK work exactly as usual. The kernel runs on the image's own Python through a virtual environment that can see everything the provider preinstalled.
| Provider | What the stock image carries |
|---|---|
| Amazon Web Services | Ubuntu 22.04 with the NVIDIA driver on GPU machines; system Python 3.10 and Miniconda. No compilers or build tools. |
| Nebius | Ubuntu 24.04 with the CUDA 13.0 toolkit and the NVIDIA driver; system Python 3.12. |
| Lambda | Lambda Stack on Ubuntu 22.04: PyTorch, TensorFlow and JAX preinstalled, with the NVIDIA driver and CUDA; system Python 3.10 and Miniconda. |
| DigitalOcean | The AI/ML Ready image: Ubuntu with the NVIDIA driver and CUDA toolkit; system Python 3. |
Where the image carries Miniconda (~/miniconda3), conda is on your PATH
but its base environment is not activated, so python and pip in the
terminal and over SSH are the kernel's, as in a cell. Run conda activate base
when you want conda's. Compilers are not preinstalled on every image: with
passwordless sudo, sudo apt-get install -y build-essential cmake adds them
for the life of the runtime (a stop discards them, like everything outside
~/workspace).
Pick it when you want the provider's stack exactly as shipped, or a runtime
with nothing to build. The choice is per cloud: the picker greys it out, with
the reason, where the selected provider does not offer it, and switching
provider to one that lacks it puts the picker back on an image. Packages you
pip install on a provider-default runtime persist for the next
provider-default runtime on the same cloud, separately from any environment's
(see Packages in your runtime). Such a runtime cannot be
saved as an environment: its packages come from the host image rather than
from a recipe the builder could reproduce.
Bake large environments into an image
Your workspace is a network filesystem. It pays a metadata round trip for every file it creates, so installing a large stack onto it is slow: a conda environment of about 90,000 files took about 50 minutes to create there, and its first import was slow on every new runtime. An image is built once, on a build machine, and every runtime starts with it already in place.
- Put anything large or compiled (PyTorch, CUDA libraries, a conda solve, a
compiled extension) into an environment recipe: a pip list, a conda
environment.ymlor a Dockerfile. - Use
pip installin a session for small additions only; see Packages in your runtime. - On a runtime outside AWS the workspace is far slower still for anything made of many small files, so an interpreter or conda environment that cannot go into an image belongs on the runtime's scratch disk; see On clouds other than AWS.
- Save a session's installs as an environment once you know which ones you want to keep.
Building your own
New Environment on the Environments page offers these starts:
- Templates: start from a template's recipe.
- Upload requirements.txt: import the packages from a file you have.
- Manual: an empty pip recipe.
- Conda environment.yml: paste or upload a conda file.
- Dockerfile: upload a file named
Dockerfileor*.Dockerfile.
The last two appear where the platform offers those recipe kinds.
Recipe kinds
The Recipe control at the top of the builder picks how the image is made.
| Kind | What you write | What the build does |
|---|---|---|
| pip | Packages, apt packages, post-install commands. | Installs the Python you chose and your packages on the platform base. |
| conda | An environment.yml, plus every pip recipe field. | Solves the file with micromamba into /opt/conda/envs/ns, then applies the pip packages, apt packages, post-install commands, variables and secrets, so they land in that environment. |
| dockerfile | A Dockerfile and up to 32 small text files. | Builds your stages as written, then appends the platform's runtime layer. |
Switching kind on an existing environment keeps the fields that still apply and clears the rest. Every kind builds on the same pipeline, is verified against the runtime contract before its image is pushed, and launches the same way.
Python
Every kind runs any CPython 3.8 or newer that the build can install, which
today means 3.8 to 3.14. You may pin an exact patch, for example 3.11.9;
a line alone, 3.11, takes its newest patch.
- A pip recipe installs the interpreter you pick in the builder.
- A conda recipe takes it from the
python=pin inenvironment.yml. - A Dockerfile recipe adopts the image's own
python3.
The neural_studio SDK for experiment tracking is installed on 3.10 to
3.13. On other lines the kernel works but the SDK is skipped, and the card
says SDK unavailable. Python 3.8 and 3.9 are end-of-life and no longer
receive security fixes; the builder shows an advisory when you pick one.
pip recipes
The builder shows:
- Name, Description and Tags.
- Base Image: Slim (CPU) for CPU runtimes, or CUDA (GPU) with a CUDA version and a CUDA flavor. The build pulls NVIDIA's image for the release you pick and installs the platform on top of it. A machine whose driver is too old for that release is refused at launch, with the numbers.
- Python version: the line, with an optional exact patch.
- Python packages, one per row, with an optional version. Names must be plain package names and versions plain specifiers; a row can never carry a pip flag or an index URL. Import from requirements.txt fills the list from a file, and package search finds names as you type.
- Package sources: a Primary index URL and extra indexes, for a private index. Keep the credential out of the URL and use a build secret instead.
- System Packages: apt packages baked into the image, for example
ffmpeg. - Post-install Commands: shell commands run after the packages install,
for example
pip install -e .. - Environment Variables: set in every runtime on this environment. The
loader keys
LD_PRELOAD,LD_LIBRARY_PATH,PYTHONPATH,DYLD_INSERT_LIBRARIESandDYLD_LIBRARY_PATHare refused. Never put a credential here: use a secret. - Runtime Secrets and Build Secrets: the names of workspace secrets to deliver to the runtime or to the build; see Isolation and secrets.
- Visibility: recorded with the environment. Other people get access by sharing (below) or, for templates, from the platform.
The caps on each list are on the limits page.
conda recipes
A conda recipe is a pip recipe plus an environment.yml. The build solves
the file with micromamba into /opt/conda/envs/ns with strict channel
priority, and that environment's interpreter becomes the kernel's Python.
The pip packages, apt packages, post-install commands, environment variables
and secrets of the recipe still apply, and the pip packages are installed
into the conda environment. The Packages list is titled Extra pip
packages for this kind.
name: idp
channels:
- conda-forge
- pytorch
- nvidia
dependencies:
- python=3.11
- pytorch=2.4.1
- pytorch-cuda=12.1
- pyg=2.6.1
- pip
- pip:
- torch_geometric==2.6.1
Rules the file must follow:
- Channels.
conda-forgeis the default when you list none, andnodefaultsis always applied, so nothing is pulled from a channel you did not name. Anaconda's licensed channels (defaults,main,anaconda,r,msys2,free,pro,mro) are refused: a shared platform cannot route your builds to a repository whose terms bill commercial use. Channel URLs must behttps. - Python. Pin it as
python=3.Xorpython=3.X.Y. A file without a pin getspython=3.12. A range such aspython>=3.10is refused. - The file is re-rendered. The build uses a canonical copy of your file (name, channels, dependencies, pip list) rather than the raw text, so an unknown key cannot change the solve.
- The file is at most 64 KiB.
Dockerfile recipes
A Dockerfile recipe is your Dockerfile (at most 64 KiB) plus up to 32 text
files for its build context (1 MiB in total, relative paths), environment
variables, secrets and the egress setting. The other recipe fields do not
apply to this kind and are refused when sent with it. A Dockerfile that is
a single FROM line is how you bring your own image.
FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-runtime
RUN pip install torch_geometric==2.6.1
Base images. FROM and COPY --from may name images on docker.io,
ghcr.io, quay.io, nvcr.io, public.ecr.aws and mcr.microsoft.com.
Private registries, Amazon ECR hosts and scratch are refused. Docker Hub
images are fetched through the platform's pull-through cache. Before the
build starts, every external image is resolved to a digest, and the revision
records each one under its base images, so the card shows exactly what the
image was built from.
What the platform adds. After your last stage the build appends its own
steps: it switches to root, resets the shell, copies the platform's runtime
layer (/opt/ns and /etc/ns) from the pinned platform image, sets the
platform environment, runs the assembly script, restores your environment
variables, clears ENTRYPOINT, sets CMD ["bash"] and makes /home/user
the working directory. The assembly script:
- Adopts the image's
python3as the kernel's interpreter when it is 3.8 or newer, or the interpreter named byENV NS_USER_PYTHON=/path/to/python3. Otherwise it installs CPython 3.12. - Creates the runtime user
userwith uid 1000 and passwordless sudo. An account that already holds uid 1000 is removed. - Needs a Debian or Ubuntu amd64 base, because it installs packages with apt. Other distributions fail the build.
Refused constructs. The build names the line when it refuses one of
these: # syntax= and # escape= directives, heredocs, ONBUILD,
MAINTAINER, RUN --network, RUN --security, SSH mounts, and secret
mounts whose id is not a declared build secret.
Secrets. A build secret reaches a step only through a mount, read from
/run/secrets/NAME:
RUN --mount=type=secret,id=HF_TOKEN \
HF_TOKEN="$(cat /run/secrets/HF_TOKEN)" python download.py
Name the secret under Build Secrets first. Never COPY, ARG or ENV
a credential: it would land in an image layer or the build log.
Builds
Saving a recipe starts a build. The card shows its state: pending, building, success or failed. Editing a recipe builds a new revision; runtimes already running on the old image are not affected. Each kind gets its own build machine and time limit, and is billed per minute of build time, failed builds included:
| Kind | Build machine | Time limit | Cost |
|---|---|---|---|
| pip | Standard (4 vCPU, 8 GiB) | 60 minutes | 1 credit per minute |
| conda | Large (8 vCPU, 16 GiB) | 120 minutes | 2 credits per minute |
| dockerfile | Large (8 vCPU, 16 GiB) | 180 minutes | 2 credits per minute |
A build that runs past its limit is failed. An account runs at most 3 builds at once and queues the rest; at most 20 may be queued or running, and a new one past that is refused until some finish. The compressed image may be at most 30 GiB; a larger one fails before anything is pushed. Every kind runs the same verification inside the built image before it is pushed: the kernel imports, the SDK imports on the lines that support it, the kernel is registered on your interpreter, the runtime user exists and the tools are present. A failed build shows which stage failed and, to the owner only, the last lines of the build log.
From a running notebook
When you pip install in a session, the packages persist for the next
runtime on the same environment, but they are not part of the image. To bake
them in, use Save a copy as Environment in the notebook's File menu, or
accept Save as Environment when you press Stop. It runs pip freeze on
the runtime and creates a new environment whose build includes those
packages, so every future runtime on any machine starts with them and your
collaborators can launch the same thing. See
Packages in your runtime. A runtime on the
provider default environment cannot be saved
this way; the option is disabled for it. Nor can a runtime on a conda or
Dockerfile environment: pip freeze cannot reproduce that image, so edit
the recipe on the Environments page instead.
Sharing an environment
Share on an environment's card gives a named person access to it; it
appears under Shared with me on their side and they can Fork it into
their own account. What a recipient sees is redacted: the recipe shape, with
environment-variable values blanked, and the environment.yml, Dockerfile,
build-context files, build error text and build log withheld. Secret
names are visible and copied on fork, and they resolve against the
launching workspace's secrets, never the author's, which is what makes a
shared environment safe to launch. A recipient who edits gets a fork with a
fresh id; the original is never modified.
Every share is scanned for credential-shaped strings first; see Sharing.
Card actions
| Action | Who | What it does |
|---|---|---|
| Edit Environment | Owner | Change the recipe and rebuild. |
| Duplicate | Anyone who can see it | A copy under your account, for templates and shared environments too. |
| Share | Owner | Give a named person access. |
| Delete Environment | Owner | Remove the environment and its image. Refused while a runtime is using it. |
An environment created in a workspace is deleted with that workspace; see Workspaces.
Related
- Packages in your runtime: what persists across stop and start without a rebuild.
- Isolation and secrets: secrets by name, build secrets, how a Dockerfile build is fenced, and what a shared recipe reveals.
- Limits: list sizes, file sizes, build limits and refused keys.