Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codestyle-python-flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Flake8
run: pip install flake8
- name: Install dependencies
run: pip install -r dev-requirements.txt
- name: Run Flake8
run: flake8 python tests/python tests/fixtures
2 changes: 1 addition & 1 deletion .github/workflows/unittests-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
with:
python-version: "3.11"
- name: Install dependencies
run: pip install pytest
run: pip install -r dev-requirements.txt
- name: Run pytest
run: pytest tests/python
8 changes: 7 additions & 1 deletion .github/workflows/unittests-vim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ jobs:
- name: Install Vim and Neovim
run: |
sudo apt-get update
sudo apt-get install -y vim neovim
sudo apt-get install -y vim neovim python3-venv
- name: Install Python dependencies
run: |
python3 -m venv .venv
.venv/bin/pip install -r dev-requirements.txt
- name: Run Vimscript tests (Neovim then Vim)
run: |
set +e
export VIRTUAL_ENV="$PWD/.venv"
export PATH="$VIRTUAL_ENV/bin:$PATH"
rm -f nvim-test.log vim-test.log

echo
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Changelog

## [1.1.0] - 2026-06-20

### Added
- Added a Python session cache for experiments, run summaries, run details,
metric histories, and artifact trees to avoid re-querying MLflow on every
redraw.
- Added `g:vim_mlflow_runs_cache_mode` with `selected_expt` and `all_expts`
modes for controlling run-summary cache scope.
- Added `g:vim_mlflow_plotpane_pct` to control the plot-versus-artifact height
split when both panes are visible.
- Added `pandas` as an explicit dependency and expanded automated coverage for
cache behavior, viewer layout, and artifact rendering.
- Added pretty-printed display for valid `.json` artifacts in the scratch
viewer buffer, with raw-text fallback for invalid JSON.

### Changed
- Refactored the main `__MLflow__` sidebar and `__MLflowRuns__` comparison view
to render from cached in-memory data instead of repeatedly rebuilding from
fresh MLflow API calls.
- Changed the viewer layout to a shared opposite-side viewer column with plots
stacked above artifacts.
- Changed the runs-window undo-layout mapping from `<C-u>` to `u`, with a
confirmation prompt before clearing all column layout tweaks.
- Made vim-mlflow-managed MLflow, runs, plot, and artifact buffers explicitly
use `nowrap` and `noswapfile` instead of depending on editor defaults.
- Updated README and Vim help documentation for caching, viewer layout, JSON
display, and new configuration settings.

### Fixed
- Fixed repeated redraws so section toggles, artifact directory expansion, and
experiment/run selection preserve the visible scroll position much more
reliably.
- Fixed artifact buffer identity so similarly named artifacts from different
runs no longer collide.
- Fixed artifact and plot viewer placement so the main `__MLflow__` buffer stays
pinned while viewer panes are reused predictably.
- Fixed noisy artifact-open status messages that previously triggered hit-enter
prompts in Vim.
- Fixed Neovim wrapping issues that broke table and artifact display layouts.
110 changes: 28 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@
[![codestyle-python-flake8](https://github.com/aganse/vim-mlflow/workflows/codestyle-python-flake8/badge.svg)](https://github.com/aganse/vim-mlflow/actions/workflows/codestyle-python-flake8.yml)
[![codestyle-vimscript-vint](https://github.com/aganse/vim-mlflow/workflows/codestyle-vimscript-vint/badge.svg)](https://github.com/aganse/vim-mlflow/actions/workflows/codestyle-vimscript-vint.yml)
![licence](https://img.shields.io/badge/license-MIT-blue.svg)
![version](https://img.shields.io/badge/version-1.0.2-blue.svg)
![version](https://img.shields.io/badge/version-1.1.0-blue.svg)


`Vim‑mlflow` is a lightweight Vim/NVim plugin that lets you browse and interact
with MLflow experiments, runs, metrics, parameters, tags, and artifacts directly
in your Vim editor. It opens a dedicated sidebar and a detail pane so you can
explore data without leaving the terminal, even allowing you to plot metric
histories and browse non-graphical artifacts. The plugin is written in
Vimscript with embedded Python and talks to MLflow through its Python API.
It works with both MLflow3.x and MLflow2.x ML tracking servers (but not the
GenAI traces/etc in MLflow3.x currently; feedback/demand can guide such future
steps).
`Vim‑mlflow` is a Vim/NVim plugin that lets you browse and interact with MLflow
experiments, runs, metrics, parameters, tags, and artifacts directly in your
Vim editor. It opens a dedicated sidebar and a detail pane so you can explore
data without leaving the terminal, even allowing you to plot metric histories
and browse non-graphical artifacts. The plugin is written in Vimscript with
embedded Python and talks to MLflow through its Python API. It works with both
MLflow3.x and MLflow2.x ML tracking servers (but not the GenAI traces/etc in
MLflow3.x currently).

[![example vim-mlflow screenshot](doc/demo_1.0.0_light.gif)](doc/demo_1.0.0_light.gif)
[![example vim-mlflow screenshot](doc/demo_1.1.0_light.gif)](doc/demo_1.1.0_light.gif)


## TL;DR
* Must run Vim/NVim in a python environment with `mlflow` installed.
* Must run Vim/NVim in a python environment with `mlflow` and `pandas` installed.
* Vim must be a compiled-with-python version (check `vim --verison` for `+python3`);
or for NVim just install the `pynvim` package in that python environment as well.
* Put `Plugin 'aganse/vim-mlflow'` or your package manager equivalent in your
Expand All @@ -46,8 +45,8 @@ steps).
- `python3 -m venv .venv`
- `source .venv/bin/activate # syntax for linux/mac`

#### 3. Install the `mlflow` Python package (and also `pynvim` for Nvim):
- `pip install mlflow` (in both Vim and NVim)
#### 3. Install the required Python packages (`mlflow`, `pandas`, and `pynvim` for Nvim):
- `pip install mlflow pandas` (in both Vim and NVim)
- In NVim you also need this package in your env to support the python:
`pip install pynvim`

Expand All @@ -67,13 +66,12 @@ steps).
- The Configuration section has quite a list of settings (colors, characters,
sizing, etc) that can be customized.

- For NVim you may need to set `setlocal nowrap` in your resource file - see
last Troubleshooting tip below regarding line-wrap default in NVim affecting
content layout.
- vim-mlflow manages `nowrap` itself for its scratch buffers, so no extra NVim
line-wrap setting should normally be needed.


## Usage
* Ensure you're in your python environment with MLflow before starting Vim.
* Ensure you're in your python environment with `mlflow` and `pandas` before starting Vim.
* Press `\m` to start vim-mlflow (default setting, ie leader-key and m. or can
use `:call RunMLflow()`). You can update that leader/key mapping via
`nnoremap <leader>m :call RunMLflow()<CR>`.
Expand All @@ -91,14 +89,16 @@ steps).

## Configuration
Only `g:mlflow_tracking_uri` is required to be set by user (e.g. in resource file).
But a typical small set of vim-mlflow config variables that one might set is:
But a typical small set of vim-mlflow config variables that one would usually set is:
```vim
" Vim-mlflow settings
let g:mlflow_tracking_uri = "http://localhost:5000" " running locally or via ssh-tunnel
let g:vim_mlflow_icon_useunicode = 1 " default 0 value uses ascii chars instead
let g:vim_mlflow_width = get(g:, 'vim_mlflow_width', 50) " width of mlflow window
let g:vim_mlflow_expts_length = 10 " experiments to show at a time
let g:vim_mlflow_runs_length = 15 " runs to show at a time
let g:vim_mlflow_plotpane_pct = 66 " plot pane height % when artifact pane is also open
let g:vim_mlflow_runs_cache_mode = 'selected_expt' " (or 'all_expts') how much to query at once
```

By default Vim-mlflow uses standard color groups like "Comment" and "Statement"
Expand All @@ -107,47 +107,18 @@ work" in vim-mlflow. (E.g. the animated GIF above used
[PaperColor](https://github.com/vim-scripts/PaperColor.vim) colorscheme;
see also its [dark-mode equivalent animated GIF](doc/demo_1.0.0_dark.gif)).
But all details can be changed, per listing below.
With no configuration parameters set, ascii characters with no color are used.
With no configuration parameters set, ASCII characters with no color are used.

See the [full listing of vim-mlflow config variables](doc/configuration_params.md)
that may be of interest to set in your resource file.


## Troubleshooting
- The sidebar may be slow on high-latency MLflow connections because each
refresh starts a short-lived Python process and re-queries MLflow.
Performance seems fine when Vim runs close to the tracking server; running
all components in AWS within same region, it has worked well for our team.
On slower links, increasing `g:vim_mlflow_timeout` may help. A future version
could use a persistent Python process to reduce queries if necessary, but so
far this has not been a common enough concern.
- Unicode icons require a font that includes box-drawing characters. Set
`g:vim_mlflow_icon_useunicode = 0` if glyphs look broken as the simple quick
fix, and also note there are config vars to change individual icon characters.
- Text artifacts (`*.txt`, `*.json`, `*.yaml`, `MLmodel`) open directly in the
plugin. Binary artifacts are listed but cannot be opened in the plugin.
- If the plugin fails to load in classic Vim, verify that Vim supports Python
(vim --version) and that mlflow is importable in Vim’s Python environment
(:py3 import mlflow). In Neovim, also ensure pynvim is installed.
- In NVim if the layout seems screwy, check step 5 above in Installation
regarding `nowrap`.
- Neovim enables line wrapping by default, which can break table layouts in
this plugin. Adding `setlocal nowrap` fixes this globally. The issue is most
noticeable in the MLflowRuns window (opened with R), which displays many
columns.


## Contributing
Contributions are welcome; just note this project is maintained on a best-effort
basis by a single maintainer (Andy Ganse) alongside other commitments, and so
focused on long-term maintainability more than rapid feature growth. Bug fixes,
documentation improvements, and small, well-scoped enhancements are the most
likely to be accepted. Feature requests may be declined if they significantly
increase complexity, maintenance burden, or diverge from the project’s stated
scope. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening issues or
pull requests, and note that response and review times may not be fast.

#### Dev tools to be aware of when contributing
Contributions are welcome. This project is maintained on a best-effort basis,
so bug fixes, documentation improvements, and small, well-scoped enhancements
are the most likely to be accepted. Please read [CONTRIBUTING.md](CONTRIBUTING.md)
before opening issues or pull requests.

This repo has unittests and codestyle checks, implemented in both CI workflows
and also available locally via the following Makefile calls. To run these you
need a few more packages in your Python environment than when just using the
Expand All @@ -161,41 +132,16 @@ CI workflows):
- `make codestyle` lints the Vimscript in `plugin/` with `vint` and the
Python in `python/` with `flake8`.

#### Related repos you may find useful to populate an MLflow installation with test data
The following tools are useful in their own right to get an MLflow instance up
and running quickly and to get some modeling up and running quickly.
But in this case you may find them convenient to populate test contents into
a temporary MLflow tracking server for dev/test purposes - they created the
contents seen in screencast above:
* [aganse/docker_mlflow_db](https://github.com/aganse/docker_mlflow_db):
ready-to-run MLflow server with PostgreSQL, AWS S3, Nginx
* [aganse/py_torch_gpu_dock_mlflow](https://github.com/aganse/py_torch_gpu_dock_mlflow):
ready-to-run Python/PyTorch/MLflow-Projects setup to train models on GPU


## Legacy/older versions
Legacy/older versions of this plugin can be accessed by git checking out an
earlier version locally, and then referencing it in your .vimrc (for classic
Vim like `Plugin 'file:///my/path/to/python/vim-mlflow'`.
Or similarly you can set that path in your runtimepath in NVim (without the
`file://`).
That said, it's recommended to use >= v1.0.0 - that's the first "official"
release (we'll just keep adding to this table as more releases come out).

| vim-mlflow git tag | tested with mlflow version | tested with vim version |
| ---------------------| -------------------------- | ----------------------- |
| v0.8 | 1.26.1 | vim 8.2 |
| v0.9 | 1.30.0, 2.7.1 | vim 8.2 |
| v1.0.0 (this version)| 2.12.0, 2.19.0, 3.6.0 | vim 9.1, nvim v0.11.5 |


## Making the animated screen-shot gif
Just so I remember for next time:
* Install [rust](https://rust-lang.org/tools/install) (`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`)
* Install [asciinema](https://github.com/asciinema/asciinema) (`cargo install --locked --git https://github.com/asciinema/asciinema`)
* `~/.cargo/bin/asciinema rec demo.cast # start recording terminal screen to file`
* Manually conduct the usage sequence to record, which gets saved to file; ctrl-D to exit/end when done.
* Install [agg](https://github.com/asciinema/agg) (`cargo install --git https://github.com/asciinema/agg`)
* `~/.cargo/bin/agg --speed 2 demo.cast demo.gif # convert the asciinema cast to animated gif`
* `~/.cargo/bin/agg --font-size 24 --speed 2 --theme github-light --font-family "SauceCodePro Nerd Font" demo.cast demo.gif # convert the asciinema cast to animated gif`
(the "SauceCodePro Nerd Font" is what my system uses but that arg can be left out)


## Acknowledgements
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.1.0
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mlflow
pandas
pynvim
pytest
flake8
Expand Down
9 changes: 5 additions & 4 deletions doc/configuration_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Full list of vim-mlflow config variables that may be of interest to set in resou
| `g:mlflow_tracking_uri` _(required)_ | The MLFLOW_TRACKING_URI of the MLflow tracking server to connect to (default is `"http://localhost:5000"`)|
| `g:vim_mlflow_timeout` | Timeout in float seconds if cannot access MLflow tracking server (default is 0.5)|
| `g:vim_mlflow_buffername` | Buffername of the MLflow side pane (default is `__MLflow__`)|
| `g:vim_mlflow_runs_buffername` | Buffername of the MLflowRuns side pane (default is `__MLflow__`)|
| `g:vim_mlflow_vside` | Which side to open the MLflow pane on: 'left' or 'right' (default is `right`)|
| `g:vim_mlflow_runs_buffername` | Buffername of the MLflowRuns side pane (default is `__MLflowRuns__`)|
| `g:vim_mlflow_vside` | Which side to open the MLflow pane on: 'left' or 'right' (default is `left`)|
| `g:vim_mlflow_hside` | Whether to open the MLflowRuns pane 'below' or 'above' (default is `below`)|
| `g:vim_mlflow_width` | Width of the vim-mlflow window in chars (default is 70)|
| `g:vim_mlflow_height` | Width of the vim-mlflow window in chars (default is 10)|
| `g:vim_mlflow_height` | Height of the MLflowRuns window in rows (default is `10`)|
| `g:vim_mlflow_expts_length` | Number of expts to show in list (default is 8)|
| `g:vim_mlflow_runs_length` | Number of runs to show in list (default is 8)|
| `g:vim_mlflow_runs_cache_mode` | Cache run summaries for `'selected_expt'` (default) or eagerly for `'all_expts'`|
| `g:vim_mlflow_viewtype` | Show 1:activeonly, 2:deletedonly, or 3:all expts and runs (default is 1)|
| `g:vim_mlflow_show_scrollicons` | Show the little up/down scroll arrows on expt/run lists, 1 or 0 (default is 1, ie yes show them)|
| `g:vim_mlflow_icon_useunicode` | Allow unicode vs just ascii chars in UI, 1 or 0 (default is 0, ascii)|
Expand All @@ -37,7 +38,7 @@ Full list of vim-mlflow config variables that may be of interest to set in resou
| `g:vim_mlflow_color_between_plotpts` | Highlight group for line segments between points (default `'Comment'`)|
| `g:vim_mlflow_plot_height` | ASCII plot height in rows when graphing metric history (default `25`)|
| `g:vim_mlflow_plot_width` | ASCII plot width in columns (default `70`)|
| `g:vim_mlflow_plotpane_pct` | Plot pane height percent when both plot and artifact panes are visible (default `66`)|
| `g:vim_mlflow_plot_xaxis` | `'step'` or `'timestamp'` for metric plot x-axis (default `'step'`)|
| `g:vim_mlflow_plot_reuse_buffer` | If `1`, reuse a single `__MLflowMetricPlot__` buffer; if `0`, create sequential plot buffers (default `1`)|
| `g:vim_mlflow_artifacts_max_depth` | Maximum artifact directory depth shown when expanding folders (default `3`)|

Binary file added doc/demo_1.1.0_dark.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/demo_1.1.0_light.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 10 additions & 11 deletions doc/description.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
`Vim‑mlflow` is a lightweight Vim/NVim plugin that lets you browse and interact
with MLflow experiments, runs, metrics, parameters, tags, and artifacts directly
in your Vim editor. It opens a dedicated sidebar and a detail pane so you can
explore data without leaving the terminal, even allowing you to plot metric
histories and browse non-graphical artifacts. The plugin is written in
Vimscript with embedded Python and talks to MLflow through its Python API.
It works with both MLflow3.x and MLflow2.x ML tracking servers (but not the
GenAI traces/etc in MLflow3.x currently; feedback/demand can guide such future
steps).
`Vim‑mlflow` is a Vim/NVim plugin that lets you browse and interact with MLflow
experiments, runs, metrics, parameters, tags, and artifacts directly in your
Vim editor. It opens a dedicated sidebar and a detail pane so you can explore
data without leaving the terminal, even allowing you to plot metric histories
and browse non-graphical artifacts. The plugin is written in Vimscript with
embedded Python and talks to MLflow through its Python API. It works with both
MLflow3.x and MLflow2.x ML tracking servers (but not the GenAI traces/etc in
MLflow3.x currently).


## TL;DR
* Must run Vim/NVim in a python environment with `mlflow` installed.
* Must run Vim/NVim in a python environment with `mlflow` and `pandas` installed.
* Vim must be a compiled-with-python version (check `vim --verison` for `+python3`);
or for NVim just install the `pynvim` package in that python environment as well.
* Put `Plugin 'aganse/vim-mlflow'` or your package manager equivalent in your
Expand All @@ -23,7 +22,7 @@ steps).


## Usage
* Ensure you're in your python environment with MLflow before starting Vim.
* Ensure you're in your python environment with `mlflow` and `pandas` before starting Vim.
* Press `\m` to start vim-mlflow (default setting, ie leader-key and m. or can
use `:call RunMLflow()`). You can update that leader/key mapping via
`nnoremap <leader>m :call RunMLflow()<CR>`.
Expand Down
9 changes: 4 additions & 5 deletions doc/installdetails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
- `python3 -m venv .venv`
- `source .venv/bin/activate # syntax for linux/mac`

#### 3. Install the `mlflow` Python package (and also `pynvim` for Nvim):
- `pip install mlflow` (in both Vim and NVim)
#### 3. Install the required Python packages (`mlflow`, `pandas`, and `pynvim` for Nvim):
- `pip install mlflow pandas` (in both Vim and NVim)
- In NVim you also need this package in your env to support the python:
`pip install pynvim`

Expand All @@ -32,6 +32,5 @@
- The Configuration section has quite a list of settings (colors, characters,
sizing, etc) that can be customized.

- For NVim you may need to set `setlocal nowrap` in your resource file - see
last Troubleshooting tip below regarding line-wrap default in NVim affecting
content layout.
- vim-mlflow manages `nowrap` itself for its scratch buffers, so no extra NVim
line-wrap setting should normally be needed.
Loading
Loading