python-tools gives LM Studio local models tools for trusted local Python work. It is for users who want a model to run Python code, manage Python files, check syntax, use selected Python interpreters, and install packages on their own machine.
This plugin executes Python code on the local machine. It is trusted local execution, not a sandbox.
Python code can read and write files and run operations according to the user's operating system permissions. pip install and pip uninstall can execute package-maintainer code. Only run code and install packages you trust.
Install from LM Studio Hub. Use the Run in LM Studio or Hub install flow, then enable or use the plugin in a chat where tools are available.
python-toolsExact interface wording may vary between LM Studio versions.
| Tool | Purpose |
|---|---|
run_python | Run inline Python code and return output, errors, exit status, and the interpreter used. |
run_python_file | Run a Python file from the workspace with the selected interpreter. |
run_python_interactive | Run inline Python code in a visible terminal window where supported. |
run_python_file_interactive | Run a Python file in a visible terminal window where supported. |
install_module | Install a Python package for the selected interpreter. |
uninstall_module | Uninstall a Python package from the selected interpreter. |
switch_python_version | List or switch Python interpreters. |
save_python_file | Save a Python file inside the workspace. |
read_python_file | Read a Python file inside the workspace. |
list_directory | List files and folders inside the workspace. |
edit_python_file | Edit a Python file by text replacement. |
edit_python_file_by_line | Edit a Python file by line number. |
check_for_bugs | Check inline Python code for syntax or compile errors. |
check_for_bugs_in_file | Check a Python file for syntax or compile errors. |
list_tools | List the tools registered by the plugin. |
Python tools use the currently selected interpreter. run_python reports pythonExecutableUsed so users can see which Python executable ran the code.
Use switch_python_version to list or switch interpreters. Users may need to ensure Python is installed and discoverable. If supported by the tool, users can select an explicit executable path.
run_python_interactive and run_python_file_interactive open a visible terminal/window where supported. They return immediately to LM Studio.
The terminal remains open so the user can read output and errors. Windows desktop sessions are best supported. If no window opens, use the non-interactive tools or check platform support.
File tools operate inside the configured workspace/safe root. Path traversal outside the workspace should be blocked.
Users should review files created or edited by an AI model.
hello.py.hello.py with these arguments.colorama for the selected Python interpreter.switch_python_version to list and select the intended interpreter, then check pythonExecutableUsed.Run these from the plugin root:
npm install npm run typecheck npm run build lms dev lms login lms push
lms dev is for local development. lms push publishes the current plugin folder to LM Studio Hub. Check manifest.json before publishing.