Can the Monaco Editor use different line numbering based on the model?

I’m using the Monaco Editor to display some custom file types.
For these files, I need to customize the displayed line numbers based on the models. This is fine for a single model but not when I want to peek to the definition in another model/file. (For the content, the displayed line numbers don’t always start at the same number and some physical lines in the file don’t count as a line and so shouldn’t have a line number displayed next to them.)

I’m setting the custom line numbers as per the example at https://microsoft.github.io/monaco-editor/playground.html?source=v0.49.0#example-interacting-with-the-editor-customizing-the-line-numbers

This lineNumbersFunc is always the same for every file/model that is displayed, but that’s not what I want.

Is there another way to specify the line numbers? (based on models)
or
Is there a way to get the model that the line number relates to in lineNumbersFunc?

I’ve tried using editor.getModel() inside the function but this always returns the initial model, not the one being shown in the inline/peeked view.