Skip to main content
Run this example on macOS or Linux with a supported MLX backend. Windows is not supported. Linux requires one of mlx[cpu], mlx[cuda12], or mlx[cuda13]. See MLX installation.
mlx_transcribe_tools.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Install an MLX backend

On macOS, the dependency step installs the standard MLX package. On Linux, install exactly one backend for your hardware before running: uv pip install -U "mlx[cpu]", uv pip install -U "mlx[cuda12]", or uv pip install -U "mlx[cuda13]".
5

Install ffmpeg

Install ffmpeg using the macOS or Ubuntu command in the source header.
6

Add an audio file

For a standalone file, replace the agno_root_dir assignment with agno_root_dir = Path(__file__).parent.resolve(). Save the code as mlx_transcribe_tools.py, then add the audio file to storage/audio beside the script.
7

Run the example

Save the code above as mlx_transcribe_tools.py, then run:
Full source: cookbook/91_tools/mlx_transcribe_tools.py