requirements.yaml reference
Beta
The AI Runtime CLI is in Beta.
requirements.yaml defines the Python libraries installed for your workload. It is referenced from the workload YAML's environment block:
YAML
environment:
dependencies: requirements.yaml
The file format follows the Databricks Base Environment Specification.
Example
YAML
environment_version: '4'
dependencies:
- --index-url https://pypi.org/simple
- -r '/Workspace/Shared/requirements.txt'
- my-library==6.1
- /Workspace/Shared/Path/To/simplejson-3.19.3-py3-none-any.whl
In the example above:
- The Base Environment v4 image is used.
- A
requirements.txtreferenced in the Workspace is installed. my-libraryis installed at version 6.1.- A wheel in the Workspace is installed.
Reuse an existing requirements.txt
If you already maintain a requirements.txt, reference it directly from your Workspace:
YAML
version: '4'
dependencies:
- -r '/Workspace/path/to/requirements.txt'
The version field is optional and defaults to "4" if not specified.
Axolotl example
Dependency file for training with Axolotl:
YAML
version: '4'
dependencies:
# Standard build tools and MLflow
- packaging
- setuptools
- wheel
- ninja
- mlflow>=3.6
# Axolotl with flash-attn and deepspeed (no build isolation)
- --no-build-isolation
- axolotl[flash-attn,deepspeed]
# Flash attention wheel (no deps — specific CUDA / torch version)
- --no-deps
- https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp312-cp312-linux_x86_64.whl