Fearby.com

Coding for fun since 1996, Learn by doing and sharing.

Setting Up a Free Local Large Language Model on Your PC

Published on 22th June 2025 by Simon Fearby

Test Post Thumbnail

In this post you will learn how to install and run a free, private large language model (LLM) like Llama 3 on your Windows PC using Ollama. No cloud or API keys required./p>

Why am I setting up a local LLM (Ollama)?

I want to setup a local LLM running on my Windows 11, to automatically process (callable from C#) post content in order to create metadata for blog posts.

I am building a WP2Static C# Application to assist me import my old WordPress blog posts to static HTML.

I want to automate as much of this import possible as possible and having accurate and up-to-date Meta data in posts is important.

For me I am hoping to integrate this into a C# program I am writing to export WordPress to Static HTML.

Goals:

What is Ollama?

Ollama is a free, open-source tool that lets you run Large Language Models (LLMs) locally on your own Windows, macOS, or Linux machine — no internet or cloud required after setup.

What Does Ollama Do?

Models you can run with Ollama locally

Best use of each Model

Model Best Use Case Strengths Notes
llama3 General-purpose conversation, summarization, creative writing High-quality reasoning, fluent language, open weights Meta's latest model, ideal default for most tasks
mistral Fast inference, shorter completions, mobile/edge use Lightweight, low memory usage, very fast Good choice for small-scale/local scripts
codellama Code generation, explanation, debugging Code-aware prompt formatting, understands multiple languages Best used with `instruct` or `python` variants
gemma Balanced general-purpose reasoning and writing Clean open model from Google, performs well in benchmarks Similar to llama3 in scope, but smaller ecosystem
llava Image+text multimodal interaction Can answer questions about uploaded images Requires image support (API or UI), slower inference

Why Use Ollama Locally?

How to set up Ollama

1. Download OllamaSetup.exe

Downlaod Ollama

2. Run the Installer

Run the Installer

3. Installing Files

Run the Installer

4. I Opened a Windows Command Prompt and checked to see if ollama was working (it was)

4. Then I ran the command ollama run llama3 to download the

5. Models are downloaded automatically

Downloading

6. It took about an hour for all models to download on my PC

Downloading Done

Testing the ollama llama3 model

Testing the ollama codellama model

Codellama Test 1:

I exited the llama3 model and ran the command "ollama run codellama:instruct" then entered "Write some C# code to connect to a local MySQL database and query a database."

Result #1:

Testing the ollama gemma model

Gemma Test 1:

I exited the codellama:instruct model and ran the command "ollama run gemma" then entered "Write a short intro paragraph for a blog post titled: “Setting Up a Free Local Large Language Model on Your PC"

Gemma Test 2:

I entered "Write a short intro paragraph for a blog post titled: “The biggest AI inventions in the last 20 years"

Gemma Test 3:

I entered "Write about the last 100 years of space exploration"

Gemma Test 4:

I entered "Write about the potential of mining asteroids?"

Connecting to Ollama from a C# Winforms App (Proof on Concept Test App)

I wanted to use the llamam3 model to do the following..

This can be done with this prompt (stored in a string called "prompt")

I prepared the contents of the body of this post (Efergy E-Max Wireless Energy Monitor from Reduction Revolution) by removing html tags and unwanted text and characters. This was stored in a string called "sHTMLBodyText")

I checked to see if the prompt was over 12000 charachters etc

I appended the html to the prompt

I prepared the POST JSON to send to the API Endpoint

I posted this to my local endpoint

I processed the payload

Conclusion

I was able to get llama3 AI locally to read my blog post HTML (Efergy E-Max Wireless Energy Monitor from Reduction Revolution), generate a description, category and tags, Estimate the read time and word count and output as JSON

{
  "description": "The author reviews the Energy monitor from Reduction Revolution, comparing it to their previous experience with Power Pal Energy Monitor. They discuss its features, pros, and cons.",
  "category": ["Servers"],
  "tags": ["Energy Monitor", "Power Pal", "Renewable Energy", "Electric Vehicle", "Smart Meter"],
  "read_time": "5 minutes",
  "word_count": 466, 
}

This will open up a lot of automation for me from C#.

Thanks for Reading

v1.0