Prusa supplies linear advance gcode for the MK series printers, but not for the Mini, so I decided to build one to help dial in a problem I've been having.
The GCode is generated from Marlin's website found here: https://marlinfw.org/tools/lin_advance/k-factor.html
Prusa's FAQ on Linear Advance is here: https://help.prusa3d.com/en/article/linear-advance_2252
I modified it by hand to match the Prusa Mini, specifically the start and stop gcode sections (setting jerk, feedrate, mesh leveling, etc.), the actual test code in the middle is done by Marlin.
The test pattern I setup is to test PLA @ 215 for Prusament, and testing LA values between 0 - 1 at 0.04 increments. Speeds for the test are Fast: 80 and Slow: 30, which are the infill and external perimeter speeds in the "Quality" settings of Prusaslicer. The stock Prusa Mini LA for PLA with a 0.4mm nozzle is 0.2.
If you have made any modifications, such as changing the heat break or extruder, make sure to add your custom gcode lines in prepare printing block at the top. Change the M104 and M109 line to the temp you want to test at for other filaments, and uncomment the M106 if you want to enable the fan.
To use the values in your own generated gcode, open it in a text editor and modify the M900 line near the beginning.
The author hasn't provided the model origin yet.