r/PowerShell • u/ViperThunder • Sep 19 '26
Question Local AI Inline Code Suggestions - Any good options out there?
Has anyone gotten their VS Code environment set up with Local AI that works as well as copilot for inline code suggestions?
When connecting a github account to vs code, the copilot AI automatically enables and does an amazing job at inline code suggestions when writing powershell.
Sometimes, I'll just type one comment line and it'll write an entire script for me, ie:
#Get all Enabled AD Users that have a password expiration coming up in the next 7 days, and trigger a nice-looking html-formatted email to each user to inform they need to change their password
I press tab, and BOOM, half the script is already done.
I have been failing to get even close to the same behavior working for Local AI. I've pulled several different models in with Ollama, and tried several different extensions such as the Continue extension, Twinny, Code Llama and a couple others. Each has its own quirks. The best has been Code Llama, and it's still terrible. I'm convinced I'm doing something wrong.
For example, as a test, if I create a new powershell file and write: #find the password expiration date for each AD user
it suggests:$Users = get-aduser -filter {Enabled -eq $true} -Properties *#find the password expiration for each userforeach ($user in $users) {
$passwordexpirationdate = $user.passwordexpired
$passwordExpirationdate = $user.PasswordExpirationDate.ToString("MM/dd/yyyy")
$User.Samaccountname + " " + $PasswordExpirationdate}
and then it repeats the same block of code above 4 times. And that is the best I've seen so far.
This particular output is from codellama:7b-code-q6_K. I have also tried the qwen base models as well (1.5b, 7b, 13b) and they've been worse. All of these fit easily into my VRAM with plenty of room to spare.
I like Copilot, and I have configured my Github account to not allow AI to train on my data, but I am not convinced it's secure, so I would prefer to leverage my local hardware and not have to change names, email addresses, keys, etc. all the time before pasting anything into VS Code.
2
u/sCeege Sep 20 '26
I think Qwen3.8 27b is your best bet for local coding LLMs atm, unless you can afford hardware that runs Deepseek or Kimi. You're just not going to match SotA models that the big vendors offer.
You also shouldn't be putting keys into your code... wth?
4
u/teethingrooster Sep 19 '26
If you want a one line comment to make a script it sounds like you don’t want tab complete but a normal chat window with the ai.
2
u/zenmatrix83 Sep 19 '26
ollama is easy to setup but not performant, look at llama.cpp, and do a bunch of research. things like speculative decoding help, at least with 27b models, I'm not sure that much with 4b. That said local models still can be odd qwen 3.8 is considered one of the best currently
-2
u/paperpaster Sep 19 '26
Stop using AI. Write your own functions and put them in your profile.