Skip to content

Instantly share code, notes, and snippets.

@pleabargain
Created May 27, 2025 09:23
Show Gist options
  • Save pleabargain/435bece281eb0efb83c6344afd3d4730 to your computer and use it in GitHub Desktop.
Save pleabargain/435bece281eb0efb83c6344afd3d4730 to your computer and use it in GitHub Desktop.
run llama 3.2 locally get prompt and save output to file locally
# Prompt user for the prompt to Llama3.2
$llamaPrompt = Read-Host "Enter your prompt for Llama3.2"
# Take the first 10 characters of the prompt and remove all spaces
$filename = ($llamaPrompt.Substring(0, [Math]::Min(10, $llamaPrompt.Length))).Replace(" ", "")
# Set the desktop path
$desktopPath = [System.IO.Path]::Combine($env:USERPROFILE, "Desktop")
$filePath = "$desktopPath\$filename.txt"
# Run Ollama with Llama3.2 and save output to the specified file
ollama run llama3.2 "$llamaPrompt" >> "$filePath"
Write-Output "Saved to $filePath"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment