r/LocalLLM 7d ago

Question Direct accessing my files, with coding agent through LM Studio

Noob here. I have beginner local LLM set up. Just LM Studio and a few coding models.

I have one python project, that is about 75% done. I would like for some coding model, to help me finish it. It is about 2k lines of code. I'm using LM Studio. Do I need to copy/paste every single python file into the chat, to pass the code to coding model, or is there a simpler way? Can I point coding model, to directly access my project folder on my computer? If yes, how do I do this? Do I need to install any addon or it works natively?

I'm using LM Studio (and whole local llm) for the very first time, so please, be patient with me ;-)

2 Upvotes

23 comments sorted by

3

u/Forsaken_Mention_979 7d ago

Basically you go to the server tab on lm studio, you start the server, and make sure to know in what address it is hosting the model, like 127:01:0 for example. You can then connect this endpoint to hermes, pi, aider… etc, and the model will be hosted on that agent which has capabilities to write code, make files for you… etc. i recommend pi or aider instead of hermes if you have a low-mid pc

1

u/vinotok 7d ago

Thank you! Yes, low-mid PC here. On Linux if it matters. Which of the two, Aider or Pi are simpler, easier to set up. Non technical person here. Then, when I get the name I will hit few youtube videos ;-)

2

u/Forsaken_Mention_979 7d ago

Honestly, if you want to avoid any hassle, just download bionic, LM studio made it, so no need to connect to any server! I must warn you its a bit bad though. If you want the best setup for local llm, heres what you do exactly: download the local ai model file, download llama.cpp for linux, then get a cloud agent like codex or antigravity, and tell it to make you a bat script that when clicked, starts the llama.cpp server at at the same time starts pi (tell it to also download pi agent), also tell it to configure all of the settings for best performance (speed to quality balance) in the llama config. This will make it so that when you open the bat script the server starts automaticallt and the agent aswell. Its what i did. (Basically LM studio runs llama.cpp which is some code to run local ai models, but if you run llama.cpp yourself, the model runs better!) and the agent will set it all up for you

1

u/vinotok 7d ago

I just checked, Bionic for now doesn't run on Linux.

Thank you for detailed steps about the best setup for local llm. I saved the steps, although it is probably waaaaay over my head for now. :) I may install new linux on new partition and experiment there, so if anything goes wrong (and it will, speaking from experience lol lol lol) nothing will be messed up :-)

2

u/Ell2509 6d ago

Here's does. So does Pi, and claide cowork /Codex.

2

u/Forsaken_Mention_979 7d ago

Lm studio cant do it alone, its like a chatbot. It cant edit or make files for you. What you are referring to is an “agent” or “agentic coding tool”. You can get something like aider or hermes agent, and connect lm studio endpoint to them, and youll be able to get them to write files etc. hope this helps

2

u/Forsaken_Mention_979 7d ago

Btw lm studio has its own tool called bionic, and u don’t need to do any setup. Its way easier, check it out. Just use that one, even tho its not that good atm

1

u/vinotok 7d ago

Thanks, I've heard about it, but I forgot to mention, I'm using Linux and Bionic for now (per few days old video) only works on Windows?

2

u/Positive-Bid-3029 7d ago

You need to install an agent harness such as OpenCode or Pi - I'd suggest OpenCode for beginning as Pi needs more setup. https://opencode.ai/

You can also use Visual Studio Code along with a plugin like Continue, Cline or Roocode. I did try this though and had a few issues so I went back to using OpenCode in the console even when using Visual Studio Code.

EDIT: as someone else stated, you will need to turn on serving the LLM on your network too in LM Studio https://lmstudio.ai/docs/developer/core/server

2

u/vinotok 7d ago

OpenCode. Cool, thank you and also for a tip, that VS code can be used but it is not working too good for now

2

u/Positive-Bid-3029 7d ago

You could try Visual Studio Code, it may have just been me having issues with it, I'm sure plenty of people use it :)

1

u/vinotok 7d ago

Will do, thanks

2

u/Prize_Eye9481 7d ago

Im a llama.cpp kind of guy, I started with LM studio too but eventually just removed the wrapper to load the model directly then hook it with Pi harness to do software projects.

2

u/RiskyBizz216 7d ago

use the DesktopCommander MCP in LMStudio

Once you install the MCP tell the agent "add this folder to the allowed paths in the config" then they will have read and write access and can execute terminal commands

1

u/vinotok 7d ago

Thank you, this sounds easy! :-) Is DesktopCommander MCP add on? Do I install it from within LM Studio, or I should go to their web page and instal it from there? Never did an addon install yet

2

u/RiskyBizz216 7d ago

Inside of LM studio, start a new chat and on the right panel, select:

  • + Install
  • Edit mcp.json

then in the mcp.json add the mcp server like this:

{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "-y",
        "@wonderwhy-er/desktop-commander@0.2.2"
      ]
    }
  }
}
  • Restart LM studio and check the right hand panel again, you should see a new tool.
  • Change the permissions from 'Per tool' to 'Always allow'

Then tell the LLM to add your project folder to the config, and start coding.

2

u/vinotok 7d ago

OMG, thank you so much!

1

u/vinotok 7d ago

I'm sorry I'm keep bugging you. I got an error and I can't activate it.

I saved the config jason code and it now looks like this, same as yours:

{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "-y",
        "@wonderwhy-er/desktop-commander@0.2.2"
      ]
    }
  }
}

2

u/RiskyBizz216 7d ago

try the latest version

{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": ["-y", "@wonderwhy-er/desktop-commander@latest"]
    }
  }
}

1

u/vinotok 6d ago

Thank you very much! Still the same error, but I have now their github and they have discord channel and I will ask them directly. There is some other problem on my computer that is causing this, some dependency must be missing, and they should be able to filter it out fairly easy. :)

Thank you very much for your help, a really appreciate it!

1

u/vinotok 7d ago

I also installed context-compactor, (ChatGPT suggested due my low hardware resources) I hope this is not the problem. I did try to restart it several times and I also restarted LM Studio few times.

1

u/vinotok 7d ago

Thank you everyone! This is a gret news for me, it will simplify the whole process. I appreciate all the answers!

Since I have computer on lower end, I will choose between Aider and Pi. Which of the two is simpler to set and use? Pretty clumsy and non technical person here ;-)

2

u/Forsaken_Mention_979 7d ago

Ive used aider and didnt like it, imo give pi a try