diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-04 16:45:02 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-04 16:45:02 +0300 |
| commit | c57602ffa9cac34918ef057d3fb085c470e83ef2 (patch) | |
| tree | 5506c5e04337a938c1d099091eb4aeee15d84a3e /gemfeed | |
| parent | 580f83197159619428951f8faeaf7f3f2af9d8a7 (diff) | |
Update content for html
Diffstat (limited to 'gemfeed')
| -rw-r--r-- | gemfeed/2025-06-22-task-samurai.html | 7 | ||||
| -rw-r--r-- | gemfeed/2025-08-05-local-coding-llm-with-ollama.html | 457 | ||||
| -rw-r--r-- | gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html | 3 | ||||
| -rw-r--r-- | gemfeed/STUNNEL-NFS-SETUP-R1-R2.md | 277 | ||||
| -rw-r--r-- | gemfeed/aitest/cmd/aitest/main.go | 32 | ||||
| -rw-r--r-- | gemfeed/aitest/go.mod | 3 | ||||
| -rw-r--r-- | gemfeed/aitest/internal/count.go | 21 | ||||
| -rw-r--r-- | gemfeed/aitest/internal/version.go | 7 | ||||
| -rw-r--r-- | gemfeed/atom.xml | 650 | ||||
| -rw-r--r-- | gemfeed/index.html | 1 | ||||
| -rw-r--r-- | gemfeed/local-coding-LLM-with-ollama/aider-fix-package.png | bin | 0 -> 178283 bytes | |||
| -rw-r--r-- | gemfeed/local-coding-LLM-with-ollama/helix-lsp-ai.png | bin | 0 -> 59192 bytes | |||
| -rw-r--r-- | gemfeed/local-coding-LLM-with-ollama/ollama-serve.png | bin | 0 -> 260363 bytes |
13 files changed, 987 insertions, 471 deletions
diff --git a/gemfeed/2025-06-22-task-samurai.html b/gemfeed/2025-06-22-task-samurai.html index ffba945a..c6a9f151 100644 --- a/gemfeed/2025-06-22-task-samurai.html +++ b/gemfeed/2025-06-22-task-samurai.html @@ -131,7 +131,7 @@ </ul><br /> <h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> -<span>Building Task Samurai with agentic coding was a wild ride—rapid feature growth, countless fast fixes, and more merge commits I'd expected. Keep the iterations short (or maybe in my next experiment, much larger, with better and more complete design before generating a single line of code), keep tests and documentation concise, and review and refine for final polish at the end. Even with the bumps along the way, shipping a polished terminal UI in days instead of weeks is a testament to the power of agentic development.</span><br /> +<span>Building Task Samurai with agentic coding was a wild ride—rapid feature growth, countless fast fixes, and more merge commits I'd expected. Keep the iterations short (or maybe in my next experiment, much larger, with better and more complete design before generating a single line of code), keep tests and documentation concise, and review and refine for final polish at the end. Even with the bumps along the way, shipping a terminal UI in days instead of weeks is a neat little showcase vibe coding.</span><br /> <br /> <span>Am I an agentic coding expert now? I don't think so. There are still many things to learn, and the landscape is constantly evolving.</span><br /> <br /> @@ -143,6 +143,11 @@ <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-08-05-local-coding-llm-with-ollama.html'>2025-08-05 Local LLM for Coding with Ollama</a><br /> +<a class='textlink' href='./2025-06-22-task-samurai.html'>2025-06-22 Task Samurai: An agentic coding learning experiment (You are currently reading this)</a><br /> +<br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | diff --git a/gemfeed/2025-08-05-local-coding-llm-with-ollama.html b/gemfeed/2025-08-05-local-coding-llm-with-ollama.html new file mode 100644 index 00000000..dc60153d --- /dev/null +++ b/gemfeed/2025-08-05-local-coding-llm-with-ollama.html @@ -0,0 +1,457 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Local LLM for Coding with Ollama</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2025-08-05-local-coding-llm-with-ollama.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2025-08-05-local-coding-llm-with-ollama.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='local-llm-for-coding-with-ollama'>Local LLM for Coding with Ollama</h1><br /> +<br /> +<span class='quote'>Published at 2025-08-04T16:43:39+03:00</span><br /> +<br /> +<pre> + [::] + _| |_ + / o o \ | + | ∆ | <-- Ollama / \ + | \___/ | / \ + \_______/ LLM --> / 30B \ + | | / Qwen3 \ + /| |\ / Coder \ + /_| |_\_________________/ quantised \ +</pre> +<br /> +<span>With all the AI buzz around coding assistants, and being a bit concerned about being dependent on third-party cloud providers here, I decided to explore the capabilities of local large language models (LLMs) using Ollama. </span><br /> +<br /> +<span>Ollama is a powerful tool that brings local AI capabilities directly to your local hardware. By running AI models locally, you can enjoy the benefits of intelligent assistance without relying on cloud services. This document outlines my initial setup and experiences with Ollama, with a focus on coding tasks and agentic coding.</span><br /> +<br /> +<a class='textlink' href='https://ollama.com/'>https://ollama.com/</a><br /> +<br /> +<h2 style='display: inline' id='why-local-llms'>Why Local LLMs?</h2><br /> +<br /> +<span>Using local AI models through Ollama offers several advantages:</span><br /> +<br /> +<ul> +<li>Data Privacy: Keep your code and data completely private by processing everything locally.</li> +<li>Cost-Effective: Reduce reliance on expensive cloud API calls.</li> +<li>Reliability: Works seamlessly even with spotty internet or offline.</li> +<li>Speed: Avoid network latency and enjoy instant responses while coding. Although I mostly found Ollama slower than commercial LLM providers. However, that may change with the evolution of models and hardware.</li> +</ul><br /> +<h2 style='display: inline' id='hardware-considerations'>Hardware Considerations</h2><br /> +<br /> +<span>Running large language models locally is currently limited by consumer hardware capabilities:</span><br /> +<br /> +<ul> +<li>GPU Memory: Most consumer-grade GPUs (even in 2025) top out at 16–24GB of VRAM, making it challenging to run larger models like the 30B (30 billion) parameter LLMs (they go up to the 100 billion and more).</li> +<li>RAM Constraints: On my MacBook Pro with M3 CPU and 36GB RAM, I chose a 14B model (<span class='inlinecode'>qwen2.5-coder:14b-instruct</span>) as it represents a practical balance between capability and resource requirements.</li> +</ul><br /> +<span>For reference, here are some key points about running large LLMs locally:</span><br /> +<br /> +<ul> +<li>Models larger than 30B: I don't even think about running them locally. One (e.g. from Qwen, Deepseek or Kimi K2) with several hundred billion parameters could match the "performance" of commercial LLMs (Claude Sonnet 4, etc). Still, for personal use, the hardware demands are just too high (or temporarily "rent" it via the public cloud?).</li> +<li>30B models: Require at least 48GB of GPU VRAM for full inference without quantisation. Currently only feasible on high-end professional GPUs (or an Apple-silicone Mac with enough unified RAM).</li> +<li>14B models: Can run with 16-24GB GPU memory (VRAM), suitable for consumer-grade hardware (or use a quantised larger model)</li> +<li>7B-13B models: Best fit for mainstream consumer hardware, requiring minimal VRAM and running smoothly on mid-range GPUs, but with limited capabilities compared to larger models and more hallucinations.</li> +</ul><br /> +<span>The model I'll be mainly using in this blog post (<span class='inlinecode'>qwen2.5-coder:14b-instruct</span>) is particularly interesting as:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>instruct</span>: Indicates this is the instruction-tuned variant of QWE, optimised for diverse tasks including coding</li> +<li><span class='inlinecode'>coder</span>: Tells me that this model was trained on a mix of code and text data, making it especially effective for programming assistance</li> +</ul><br /> +<a class='textlink' href='https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct'>https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct</a><br /> +<br /> +<span>For general thinking tasks, I found <span class='inlinecode'>deepseek-r1:14b</span> to be useful. For instance, I utilised <span class='inlinecode'>deepseek-r1:14b</span> to format this blog post and correct some English errors, demonstrating its effectiveness in natural language processing tasks. Additionally, it has proven invaluable for adding context and enhancing clarity in technical explanations, all while running locally on the MacBook Pro. Admittedly, it was a lot slower than "just using ChatGPT", but still within minutes. </span><br /> +<br /> +<a class='textlink' href='https://ollama.com/library/deepseek-r1:14b'>https://ollama.com/library/deepseek-r1:14b</a><br /> +<br /> +<span>A quantised (as mentioned above) LLM which has been converted from high-precision connection (typically 16- or 32-bit floating point) representations to lower-precision formats, such as 8-bit integers. This reduces the overall memory footprint of the model, making it significantly smaller and enabling it to run more efficiently on hardware with limited resources or to allow higher throughput on GPUs and CPUs. The benefits of quantisation include reduced storage and faster inference times due to simpler computations and better memory bandwidth utilisation. However, quantisation can introduce a drop in model accuracy because the lower numerical precision means the model cannot represent parameter values as precisely. In some cases, it may lead to instability or unexpected outputs in specific tasks or edge cases.</span><br /> +<br /> +<h2 style='display: inline' id='basic-setup-and-manual-code-prompting'>Basic Setup and Manual Code Prompting</h2><br /> +<br /> +<h3 style='display: inline' id='installing-ollama-and-a-model'>Installing Ollama and a Model</h3><br /> +<br /> +<span>To install Ollama, IIperformed these steps (this assumes that you have already installed Homebrew on your macOS system):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>brew install ollama +rehash +ollama serve +</pre> +<br /> +<span>Which started up the Ollama server with something like this (the screenshots shows already some requests made):</span><br /> +<br /> +<a href='./local-coding-LLM-with-ollama/ollama-serve.png'><img alt='Ollama serving' title='Ollama serving' src='./local-coding-LLM-with-ollama/ollama-serve.png' /></a><br /> +<br /> +<span>And then, in a new terminal, I pulled the model with:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>ollama pull qwen2.<font color="#000000">5</font>-coder:14b-instruct +</pre> +<br /> +<span>Now, I was ready to go! It wasn't so difficult. Now, let's see how I used this model for coding tasks.</span><br /> +<br /> +<h3 style='display: inline' id='example-usage'>Example Usage</h3><br /> +<br /> +<span>I run the following command to get a Go function for calculating Fibonacci numbers:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>time echo <font color="#808080">"Write a function in golang to print out the Nth fibonacci number, \</font> +<font color="#808080"> only the function without the boilerplate"</font> | ollama run qwen2.<font color="#000000">5</font>-coder:14b-instruct + +Output: + +func fibonacci(n int) int { + <b><u><font color="#000000">if</font></u></b> n <= <font color="#000000">1</font> { + <b><u><font color="#000000">return</font></u></b> n + } + a, b := <font color="#000000">0</font>, <font color="#000000">1</font> + <b><u><font color="#000000">for</font></u></b> i := <font color="#000000">2</font>; i <= n; i++ { + a, b = b, a+b + } + <b><u><font color="#000000">return</font></u></b> b +} + +Execution Metrics: + +Executed <b><u><font color="#000000">in</font></u></b> <font color="#000000">4.90</font> secs fish external + usr time <font color="#000000">15.54</font> millis <font color="#000000">0.31</font> millis <font color="#000000">15.24</font> millis + sys time <font color="#000000">19.68</font> millis <font color="#000000">1.02</font> millis <font color="#000000">18.66</font> millis +</pre> +<br /> +<span class='quote'>Note, after having written this blog post, I tried the same with the newer model <span class='inlinecode'>qwen3-coder:30b-a3b-q4_K_M</span> (which "just" came out, and it's a quantised 30B model), and it was much faster:</span><br /> +<br /> +<pre> +Executed in 1.83 secs fish external + usr time 17.82 millis 4.40 millis 13.42 millis + sys time 17.07 millis 1.57 millis 15.50 millis +</pre> +<br /> +<a class='textlink' href='https://ollama.com/library/qwen3-coder:30b-a3b-q4_K_M'>https://ollama.com/library/qwen3-coder:30b-a3b-q4_K_M</a><br /> +<br /> +<h2 style='display: inline' id='agentic-coding-with-aider'>Agentic Coding with Aider</h2><br /> +<br /> +<h3 style='display: inline' id='installation'>Installation</h3><br /> +<br /> +<span>Aider is a tool that enables agentic coding by leveraging AI models (also local ones, as in our case). While setting up OpenAI Codex and OpenCode with Ollama proved challenging (those tools either didn't know how to work with the "tools" (the capability to execute external commands or to edit files for example) or didn't connect at all to Ollama for some reason), Aider worked smoothly.</span><br /> +<br /> +<span>To get started, the only thing I had to do was to install it via Homebrew, initialise a Git repository, and then start Aider with the Ollama model <span class='inlinecode'>ollama_chat/qwen2.5-coder:14b-instruct</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>brew install aider +mkdir ~/git/aitest && cd ~/git/aitest && git init +aider --model ollama_chat/qwen<font color="#000000">2.5</font>-coder:14b-instruct +</pre> +<br /> +<a class='textlink' href='https://aider.chat'>https://aider.chat</a><br /> +<a class='textlink' href='https://opencode.ai'>https://opencode.ai</a><br /> +<a class='textlink' href='https://github.com/openai/codex'>https://github.com/openai/codex</a><br /> +<br /> +<h3 style='display: inline' id='agentic-coding-prompt'>Agentic coding prompt</h3><br /> +<br /> +<span>This is the prompt I gave:</span><br /> +<br /> +<pre> +Create a Go project with these files: + +* `cmd/aitest/main.go`: CLI entry point +* `internal/version.go`: Version information (0.0.0), should be printed when the + program was started with `-version` flag +* `internal/count.go`: File counting functionality, the program should print out + the number of files in a given subdirectory (the directory is provided as a + command line flag with `-dir`), if none flag is given, no counting should be + done +* `README.md`: Installation and usage instructions +</pre> +<br /> +<span>It then generated something, but did not work out of the box, as it had some issues with the imports and package names. So I had to do some follow-up prompts to fix those issues with something like this:</span><br /> +<br /> +<pre> +* Update import paths to match module name, github.com/yourname/aitest should be + aitest in main.go +* The package names of internal/count.go and internal/version.go should be + internal, and not count and version. +</pre> +<br /> +<a href='./local-coding-LLM-with-ollama/aider-fix-package.png'><img alt='Aider fixing the packages' title='Aider fixing the packages' src='./local-coding-LLM-with-ollama/aider-fix-package.png' /></a><br /> +<br /> +<h3 style='display: inline' id='compilation--execution'>Compilation & Execution</h3><br /> +<br /> +<span>Once done so, the project was ready and I could compile and run it:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>go build cmd/aitest/main.go +./main --help +./main -v +<font color="#000000">0.0</font>.<font color="#000000">0</font> +./main -dir . +Number of files <b><u><font color="#000000">in</font></u></b> directory .: <font color="#000000">4</font> +</pre> +<br /> +<h3 style='display: inline' id='the-code'>The code</h3><br /> +<br /> +<span>The code it generated was simple, but functional. The <span class='inlinecode'>./cmd/aitest/main.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> main + +<b><u><font color="#000000">import</font></u></b> ( + <font color="#808080">"flag"</font> + <font color="#808080">"fmt"</font> + <font color="#808080">"os"</font> + + <font color="#808080">"aitest/internal"</font> +) + +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> versionFlag <b><font color="#000000">bool</font></b> + flag.BoolVar(&versionFlag, <font color="#808080">"v"</font>, false, <font color="#808080">"print version"</font>) + dir := flag.String(<font color="#808080">"dir"</font>, <font color="#808080">""</font>, <font color="#808080">"directory to count files in"</font>) + flag.Parse() + + <b><u><font color="#000000">if</font></u></b> versionFlag { + fmt.Println(internal.GetVersion()) + <b><u><font color="#000000">return</font></u></b> + } + + <b><u><font color="#000000">if</font></u></b> *dir != <font color="#808080">""</font> { + fileCount, err := internal.CountFiles(*dir) + <b><u><font color="#000000">if</font></u></b> err != nil { + fmt.Fprintf(os.Stderr, <font color="#808080">"Error counting files: %v\n"</font>, err) + os.Exit(<font color="#000000">1</font>) + } + fmt.Printf(<font color="#808080">"Number of files in directory %s: %d\n"</font>, *dir, fileCount) + } <b><u><font color="#000000">else</font></u></b> { + fmt.Println(<font color="#808080">"No directory specified. No count given."</font>) + } +} +</pre> +<br /> +<span>The <span class='inlinecode'>./internal/version.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> internal + +<b><u><font color="#000000">var</font></u></b> Version = <font color="#808080">"0.0.0"</font> + +<b><u><font color="#000000">func</font></u></b> GetVersion() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> Version +} +</pre> +<br /> +<span>The <span class='inlinecode'>./internal/count.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> internal + +<b><u><font color="#000000">import</font></u></b> ( + <font color="#808080">"os"</font> +) + +<b><u><font color="#000000">func</font></u></b> CountFiles(dir <b><font color="#000000">string</font></b>) (int, error) { + files, err := os.ReadDir(dir) + <b><u><font color="#000000">if</font></u></b> err != nil { + <b><u><font color="#000000">return</font></u></b> <font color="#000000">0</font>, err + } + + count := <font color="#000000">0</font> + <b><u><font color="#000000">for</font></u></b> _, file := <b><u><font color="#000000">range</font></u></b> files { + <b><u><font color="#000000">if</font></u></b> !file.IsDir() { + count++ + } + } + + <b><u><font color="#000000">return</font></u></b> count, nil +} +</pre> +<br /> +<span>Etc...</span><br /> +<br /> +<span>The code is quite straightforward, especially for generating boilerplate code this will be useful for many use cases!</span><br /> +<br /> +<h2 style='display: inline' id='in-editor-code-completion'>In-Editor Code Completion</h2><br /> +<br /> +<span>To leverage Ollama for real-time code completion in my editor, I have integrated it with Helix, my preferred text editor. Helix supports the LSP (Language Server Protocol), which enables advanced code completion features. The <span class='inlinecode'>lsp-ai</span> is an LSP server that can interface with Ollama models for code completion tasks.</span><br /> +<br /> +<a class='textlink' href='https://github.com/SilasMarvin/lsp-ai'>https://github.com/SilasMarvin/lsp-ai</a><br /> +<br /> +<h3 style='display: inline' id='installation-of-lsp-ai'>Installation of <span class='inlinecode'>lsp-ai</span></h3><br /> +<br /> +<span>I installed <span class='inlinecode'>lsp-ai</span> via Rust's Cargo package manager. (If you don't have Rust installed, you can install it via Homebrew as well.):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>cargo install lsp-ai +</pre> +<br /> +<h3 style='display: inline' id='helix-configuration'>Helix Configuration</h3><br /> +<br /> +<span>I edited <span class='inlinecode'>~/.config/helix/languages.toml</span> to include:</span><br /> +<br /> +<pre> +<<language]] +name = "go" +auto-format= true +diagnostic-severity = "hint" +formatter = { command = "goimports" } +language-servers = [ "gopls", "golangci-lint-lsp", "lsp-ai", "gpt" ] +</pre> +<br /> +<span>Note that there is also a <span class='inlinecode'>gpt</span> language server configured, which is for GitHub Copilot, but it is out of scope of this blog post. Let's also configure <span class='inlinecode'>lsp-ai</span> settings in the same file:</span><br /> +<br /> +<pre> +[language-server.lsp-ai] +command = "lsp-ai" + +[language-server.lsp-ai.config.memory] +file_store = { } + +[language-server.lsp-ai.config.models.model1] +type = "ollama" +model = "qwen2.5-coder" + +[language-server.lsp-ai.config.models.model2] +type = "ollama" +model = "mistral-nemo:latest" + +[language-server.lsp-ai.config.models.model3] +type = "ollama" +model = "deepseek-r1:14b" + +[language-server.lsp-ai.config.completion] +model = "model1" + +[language-server.lsp-ai.config.completion.parameters] +max_tokens = 64 +max_context = 8096 + +## Configure the messages per your needs +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "system" +content = "Instructions:\n- You are an AI programming assistant.\n- Given a +piece of code with the cursor location marked by \"<CURSOR>\", replace +\"<CURSOR>\" with the correct code or comment.\n- First, think step-by-step.\n +- Describe your plan for what to build in pseudocode, written out in great +detail.\n- Then output the code replacing the \"<CURSOR>\"\n- Ensure that your +completion fits within the language context of the provided code snippet (e.g., +Go, Ruby, Bash, Java, Puppet DSL).\n\nRules:\n- Only respond with code or +comments.\n- Only replace \"<CURSOR>\"; do not include any previously written +code.\n- Never include \"<CURSOR>\" in your response\n- If the cursor is within +a comment, complete the comment meaningfully.\n- Handle ambiguous cases by +providing the most contextually appropriate completion.\n- Be consistent with +your responses." + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func greet(name) {\n print(f\"Hello, {<CURSOR>}\")\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "name" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func sum(a, b) {\n return a + <CURSOR>\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "b" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func multiply(a, b int ) int {\n a * <CURSOR>\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "b" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "// <CURSOR>\nfunc add(a, b) {\n return a + b\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "Adds two numbers" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "// This function checks if a number is even\n<CURSOR>" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "func is_even(n) {\n return n % 2 == 0\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "{CODE}" +</pre> +<br /> +<span>As you can see, I have also added other models, such as Mistral Nemo and DeepSeek R1, so that I can switch between them in Helix. Other than that, the completion parameters are interesting. They define how the LLM should interact with the text in the text editor based on the given examples.</span><br /> +<br /> +<h3 style='display: inline' id='code-completion-in-action'>Code completion in action</h3><br /> +<br /> +<span>The screenshot shows how Ollama's <span class='inlinecode'>qwen2.5-coder</span> model provides code completion suggestions within the Helix editor. The LSP auto-completion is triggered by typing <span class='inlinecode'><CURSOR></span> in the code snippet, and Ollama responds with relevant completions based on the context.</span><br /> +<br /> +<a href='./local-coding-LLM-with-ollama/helix-lsp-ai.png'><img alt='Completing the fib-function' title='Completing the fib-function' src='./local-coding-LLM-with-ollama/helix-lsp-ai.png' /></a><br /> +<br /> +<span>In the LSP auto-completion, the one prefixed with <span class='inlinecode'>ai - </span> was generated by <span class='inlinecode'>qwen2.5-coder</span>, the other ones are from other LSP servers (GitHub Copilot, Go linter, Go language server, etc.).</span><br /> +<br /> +<span>I found GitHub Copilot to be still faster than <span class='inlinecode'>qwen2.5-coder:14b</span>, but the local LLM one is actually workable for me already. And, as mentioned earlier, things will likely improve in the future regarding local LLMs. So I am excited about the future of local LLMs and coding tools like Ollama and Helix.</span><br /> +<br /> +<span>After trying <span class='inlinecode'>qwen3-coder:30b-a3b-q4_K_M</span> (following the publication of this blog post), I found it to be significantly faster and more capable than the previous model, making it a promising option for local coding tasks. Experimentation reveals that even current local setups are surprisingly effective for routine coding tasks, offering a glimpse into the future of on-machine AI assistance.</span><br /> +<br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> +<br /> +<span>Will there ever be a time we can run larger models (60B, 100B, ...and larger) on consumer hardware, or even on our phones? We are not quite there yet, but I am optimistic that we will see significant improvements in the next few years. As hardware capabilities improve and/or become cheaper, and more efficient models are developed, the landscape of local AI coding assistants will continue to evolve. </span><br /> +<br /> +<span>For now, even the models listed in this blog post are very promising already, and they run on consumer-grade hardware (at least in the realm of the initial tests I've performed... the ones in this blog post are overly simplistic, though! But they were good for getting started with Ollama and initial demonstration)! I will continue experimenting with Ollama and other local LLMs to see how they can enhance my coding experience. I may cancel my Copilot subscription, which I currently use only for in-editor auto-completion, at some point.</span><br /> +<br /> +<span>However, truth be told, I don't think the setup described in this blog post currently matches the performance of commercial models like Claude Code (Sonnet 4, Opus 4), Gemini 2.5 Pro, and others. Maybe we could get close if we had the high-end hardware needed to run the largest Qwen Coder model available. But, as mentioned already, that is out of reach for occasional coders like me. Furthermore, I want to continue coding manually to some degree, as otherwise I will start to forget how to write for-loops, which can be awkward... However, do we always need the best model when AI can help generate boilerplate or repetitive tasks even with smaller models?</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-08-05-local-coding-llm-with-ollama.html'>2025-08-05 Local LLM for Coding with Ollama (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-06-22-task-samurai.html'>2025-06-22 Task Samurai: An agentic coding learning experiment</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html b/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html index 79b35bb2..1e6c5a50 100644 --- a/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html +++ b/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html @@ -613,6 +613,9 @@ http://www.gnu.org/software/src-highlite --> <span>Shutting down <span class='inlinecode'>f0</span> and let NFS failing over for the Apache content.</span><br /> <br /> <br /> +<span>TODO: openbsd relayd config</span><br /> +<span>TODO: registry howto</span><br /> +<span>TODO: anki-droid deployment</span><br /> <span>TODO: include k9s screenshot</span><br /> <span>TODO: include a diagram again?</span><br /> <span>TODO: increase replica of traefik to 2, persist config surviving reboots</span><br /> diff --git a/gemfeed/STUNNEL-NFS-SETUP-R1-R2.md b/gemfeed/STUNNEL-NFS-SETUP-R1-R2.md deleted file mode 100644 index 3c2ff77f..00000000 --- a/gemfeed/STUNNEL-NFS-SETUP-R1-R2.md +++ /dev/null @@ -1,277 +0,0 @@ -# Stunnel and NFS Configuration for r1 and r2 - -This document provides step-by-step instructions for configuring stunnel and NFS mounts on r1 and r2 Rocky Linux systems to connect to the f3s storage cluster. - -## Prerequisites - -- Root access on r1 and r2 -- Network connectivity to f0 (for copying the certificate) -- Network connectivity to the CARP VIP (192.168.1.138) - -## Overview - -The configuration provides: -- Encrypted NFS traffic using stunnel -- Automatic failover via CARP VIP (192.168.1.138) -- Persistent mounts across reboots -- Access to /data/nfs/k3svolumes for Kubernetes storage - -## Configuration Steps - -### Step 1: Install stunnel - -```bash -dnf install -y stunnel -``` - -### Step 2: Copy the stunnel certificate from f0 - -First, create the directory: -```bash -mkdir -p /etc/stunnel -``` - -Then copy the certificate from f0. On f0, run: -```bash -scp /usr/local/etc/stunnel/stunnel.pem root@r1:/etc/stunnel/ -scp /usr/local/etc/stunnel/stunnel.pem root@r2:/etc/stunnel/ -``` - -### Step 3: Create stunnel client configuration - -Create `/etc/stunnel/stunnel.conf`: -```bash -cat > /etc/stunnel/stunnel.conf <<'EOF' -cert = /etc/stunnel/stunnel.pem -client = yes - -[nfs-ha] -accept = 127.0.0.1:2323 -connect = 192.168.1.138:2323 -EOF -``` - -### Step 4: Create systemd service for stunnel - -Create `/etc/systemd/system/stunnel.service`: -```bash -cat > /etc/systemd/system/stunnel.service <<'EOF' -[Unit] -Description=SSL tunnel for network daemons -After=network.target - -[Service] -Type=forking -ExecStart=/usr/bin/stunnel /etc/stunnel/stunnel.conf -ExecStop=/usr/bin/killall stunnel -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target -EOF -``` - -### Step 5: Enable and start stunnel - -```bash -systemctl daemon-reload -systemctl enable stunnel -systemctl start stunnel -systemctl status stunnel -``` - -### Step 6: Create NFS mount point - -```bash -mkdir -p /data/nfs/k3svolumes -``` - -### Step 7: Test mount NFS through stunnel - -```bash -mount -t nfs4 -o port=2323 127.0.0.1:/data/nfs/k3svolumes /data/nfs/k3svolumes -``` - -### Step 8: Verify the mount - -```bash -mount | grep k3svolumes -df -h /data/nfs/k3svolumes -ls -la /data/nfs/k3svolumes/ -``` - -### Step 9: Configure persistent mount - -First unmount the test mount: -```bash -umount /data/nfs/k3svolumes -``` - -Add to `/etc/fstab`: -```bash -echo "127.0.0.1:/data/nfs/k3svolumes /data/nfs/k3svolumes nfs4 port=2323,_netdev 0 0" >> /etc/fstab -``` - -Mount using fstab: -```bash -mount /data/nfs/k3svolumes -``` - -## Automated Installation - -A script is available to automate all these steps: - -```bash -# Download and run the configuration script -curl -O https://raw.githubusercontent.com/.../configure-stunnel-nfs-r1-r2.sh -chmod +x configure-stunnel-nfs-r1-r2.sh -./configure-stunnel-nfs-r1-r2.sh -``` - -## Verification Commands - -After configuration, verify everything is working: - -```bash -# Check stunnel service -systemctl status stunnel - -# Check NFS mount -mount | grep k3svolumes -df -h /data/nfs/k3svolumes - -# Test write access -echo "Test from $(hostname) at $(date)" > /data/nfs/k3svolumes/test-$(hostname).txt -cat /data/nfs/k3svolumes/test-$(hostname).txt - -# Check stunnel connection -ss -tlnp | grep 2323 -``` - -## Troubleshooting - -### Stunnel won't start - -Check the logs: -```bash -journalctl -u stunnel -n 50 -``` - -Common issues: -- Certificate file missing or wrong permissions -- Port 2323 already in use -- Configuration syntax error - -### NFS mount fails - -Check connectivity: -```bash -# Test if stunnel is listening -telnet 127.0.0.1 2323 - -# Check if CARP VIP is reachable -ping -c 3 192.168.1.138 - -# Try mounting with verbose output -mount -v -t nfs4 -o port=2323 127.0.0.1:/data/nfs/k3svolumes /data/nfs/k3svolumes -``` - -### Mount not persistent after reboot - -Verify fstab entry: -```bash -grep k3svolumes /etc/fstab -``` - -Test fstab mount: -```bash -mount -a -``` - -Check for systemd mount errors: -```bash -systemctl --failed -journalctl -b | grep mount -``` - -### Permission denied errors - -The NFS export on f0/f1 maps root, so permission issues are rare. If they occur: -```bash -# Check export configuration on NFS server -showmount -e 192.168.1.138 - -# Verify your IP is allowed in the exports -# r0: 192.168.1.120 -# r1: 192.168.1.121 -# r2: 192.168.1.122 -``` - -## Security Considerations - -- All NFS traffic is encrypted through stunnel -- The certificate provides both authentication and encryption -- Access is restricted by IP address on the NFS server -- Root access is mapped (maproot=root) for Kubernetes operations - -## Integration with Kubernetes - -Once configured, Kubernetes can use this mount for persistent storage: - -```yaml -apiVersion: v1 -kind: PersistentVolume -metadata: - name: nfs-pv -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteMany - nfs: - server: 127.0.0.1 # Local stunnel - path: /data/nfs/k3svolumes - mountOptions: - - port=2323 - - nfsvers=4 -``` - -## Maintenance - -### Restarting services - -```bash -# Restart stunnel -systemctl restart stunnel - -# Remount NFS -umount /data/nfs/k3svolumes -mount /data/nfs/k3svolumes -``` - -### Updating certificates - -When certificates expire (after 10 years): -1. Generate new certificate on f0 -2. Copy to all clients (r0, r1, r2) -3. Restart stunnel on all hosts - -### Monitoring - -Add to your monitoring system: -- stunnel service status -- NFS mount presence -- Disk space on /data/nfs/k3svolumes -- Network connectivity to 192.168.1.138:2323 - -## Summary - -After completing these steps on both r1 and r2: - -1. **Stunnel** provides encrypted tunnel to NFS server -2. **NFS** mounts through stunnel on port 2323 -3. **CARP VIP** (192.168.1.138) ensures automatic failover -4. **Persistent mount** via /etc/fstab survives reboots -5. **Kubernetes** can use /data/nfs/k3svolumes for persistent volumes - -The same configuration works on r0, r1, and r2 with no modifications needed.
\ No newline at end of file diff --git a/gemfeed/aitest/cmd/aitest/main.go b/gemfeed/aitest/cmd/aitest/main.go new file mode 100644 index 00000000..130cfe0d --- /dev/null +++ b/gemfeed/aitest/cmd/aitest/main.go @@ -0,0 +1,32 @@ +package main + +import ( + "flag" + "fmt" + "os" + + "aitest/internal" +) + +func main() { + var versionFlag bool + flag.BoolVar(&versionFlag, "v", false, "print version") + dir := flag.String("dir", "", "directory to count files in") + flag.Parse() + + if versionFlag { + fmt.Println(internal.GetVersion()) + return + } + + if *dir != "" { + fileCount, err := internal.CountFiles(*dir) + if err != nil { + fmt.Fprintf(os.Stderr, "Error counting files: %v\n", err) + os.Exit(1) + } + fmt.Printf("Number of files in directory %s: %d\n", *dir, fileCount) + } else { + fmt.Println("No directory specified. No count given.") + } +} diff --git a/gemfeed/aitest/go.mod b/gemfeed/aitest/go.mod new file mode 100644 index 00000000..8fac64ee --- /dev/null +++ b/gemfeed/aitest/go.mod @@ -0,0 +1,3 @@ +module aitest + +go 1.24 diff --git a/gemfeed/aitest/internal/count.go b/gemfeed/aitest/internal/count.go new file mode 100644 index 00000000..544ace17 --- /dev/null +++ b/gemfeed/aitest/internal/count.go @@ -0,0 +1,21 @@ +package internal + +import ( + "os" +) + +func CountFiles(dir string) (int, error) { + files, err := os.ReadDir(dir) + if err != nil { + return 0, err + } + + count := 0 + for _, file := range files { + if !file.IsDir() { + count++ + } + } + + return count, nil +} diff --git a/gemfeed/aitest/internal/version.go b/gemfeed/aitest/internal/version.go new file mode 100644 index 00000000..84fa6601 --- /dev/null +++ b/gemfeed/aitest/internal/version.go @@ -0,0 +1,7 @@ +package internal + +var Version = "0.0.0" + +func GetVersion() string { + return Version +} diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 86fbc6ea..45fff1f1 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,12 +1,462 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2025-07-28T15:09:21+03:00</updated> + <updated>2025-08-04T16:43:39+03:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="https://foo.zone/gemfeed/atom.xml" rel="self" /> <link href="https://foo.zone/" /> <id>https://foo.zone/</id> <entry> + <title>Local LLM for Coding with Ollama</title> + <link href="https://foo.zone/gemfeed/2025-08-05-local-coding-llm-with-ollama.html" /> + <id>https://foo.zone/gemfeed/2025-08-05-local-coding-llm-with-ollama.html</id> + <updated>2025-08-04T16:43:39+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>With all the AI buzz around coding assistants, and being a bit concerned about being dependent on third-party cloud providers here, I decided to explore the capabilities of local large language models (LLMs) using Ollama. </summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='local-llm-for-coding-with-ollama'>Local LLM for Coding with Ollama</h1><br /> +<br /> +<pre> + [::] + _| |_ + / o o \ | + | ∆ | <-- Ollama / \ + | \___/ | / \ + \_______/ LLM --> / 30B \ + | | / Qwen3 \ + /| |\ / Coder \ + /_| |_\_________________/ quantised \ +</pre> +<br /> +<span>With all the AI buzz around coding assistants, and being a bit concerned about being dependent on third-party cloud providers here, I decided to explore the capabilities of local large language models (LLMs) using Ollama. </span><br /> +<br /> +<span>Ollama is a powerful tool that brings local AI capabilities directly to your local hardware. By running AI models locally, you can enjoy the benefits of intelligent assistance without relying on cloud services. This document outlines my initial setup and experiences with Ollama, with a focus on coding tasks and agentic coding.</span><br /> +<br /> +<a class='textlink' href='https://ollama.com/'>https://ollama.com/</a><br /> +<br /> +<h2 style='display: inline' id='why-local-llms'>Why Local LLMs?</h2><br /> +<br /> +<span>Using local AI models through Ollama offers several advantages:</span><br /> +<br /> +<ul> +<li>Data Privacy: Keep your code and data completely private by processing everything locally.</li> +<li>Cost-Effective: Reduce reliance on expensive cloud API calls.</li> +<li>Reliability: Works seamlessly even with spotty internet or offline.</li> +<li>Speed: Avoid network latency and enjoy instant responses while coding. Although I mostly found Ollama slower than commercial LLM providers. However, that may change with the evolution of models and hardware.</li> +</ul><br /> +<h2 style='display: inline' id='hardware-considerations'>Hardware Considerations</h2><br /> +<br /> +<span>Running large language models locally is currently limited by consumer hardware capabilities:</span><br /> +<br /> +<ul> +<li>GPU Memory: Most consumer-grade GPUs (even in 2025) top out at 16–24GB of VRAM, making it challenging to run larger models like the 30B (30 billion) parameter LLMs (they go up to the 100 billion and more).</li> +<li>RAM Constraints: On my MacBook Pro with M3 CPU and 36GB RAM, I chose a 14B model (<span class='inlinecode'>qwen2.5-coder:14b-instruct</span>) as it represents a practical balance between capability and resource requirements.</li> +</ul><br /> +<span>For reference, here are some key points about running large LLMs locally:</span><br /> +<br /> +<ul> +<li>Models larger than 30B: I don't even think about running them locally. One (e.g. from Qwen, Deepseek or Kimi K2) with several hundred billion parameters could match the "performance" of commercial LLMs (Claude Sonnet 4, etc). Still, for personal use, the hardware demands are just too high (or temporarily "rent" it via the public cloud?).</li> +<li>30B models: Require at least 48GB of GPU VRAM for full inference without quantisation. Currently only feasible on high-end professional GPUs (or an Apple-silicone Mac with enough unified RAM).</li> +<li>14B models: Can run with 16-24GB GPU memory (VRAM), suitable for consumer-grade hardware (or use a quantised larger model)</li> +<li>7B-13B models: Best fit for mainstream consumer hardware, requiring minimal VRAM and running smoothly on mid-range GPUs, but with limited capabilities compared to larger models and more hallucinations.</li> +</ul><br /> +<span>The model I'll be mainly using in this blog post (<span class='inlinecode'>qwen2.5-coder:14b-instruct</span>) is particularly interesting as:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>instruct</span>: Indicates this is the instruction-tuned variant of QWE, optimised for diverse tasks including coding</li> +<li><span class='inlinecode'>coder</span>: Tells me that this model was trained on a mix of code and text data, making it especially effective for programming assistance</li> +</ul><br /> +<a class='textlink' href='https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct'>https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct</a><br /> +<br /> +<span>For general thinking tasks, I found <span class='inlinecode'>deepseek-r1:14b</span> to be useful. For instance, I utilised <span class='inlinecode'>deepseek-r1:14b</span> to format this blog post and correct some English errors, demonstrating its effectiveness in natural language processing tasks. Additionally, it has proven invaluable for adding context and enhancing clarity in technical explanations, all while running locally on the MacBook Pro. Admittedly, it was a lot slower than "just using ChatGPT", but still within minutes. </span><br /> +<br /> +<a class='textlink' href='https://ollama.com/library/deepseek-r1:14b'>https://ollama.com/library/deepseek-r1:14b</a><br /> +<br /> +<span>A quantised (as mentioned above) LLM which has been converted from high-precision connection (typically 16- or 32-bit floating point) representations to lower-precision formats, such as 8-bit integers. This reduces the overall memory footprint of the model, making it significantly smaller and enabling it to run more efficiently on hardware with limited resources or to allow higher throughput on GPUs and CPUs. The benefits of quantisation include reduced storage and faster inference times due to simpler computations and better memory bandwidth utilisation. However, quantisation can introduce a drop in model accuracy because the lower numerical precision means the model cannot represent parameter values as precisely. In some cases, it may lead to instability or unexpected outputs in specific tasks or edge cases.</span><br /> +<br /> +<h2 style='display: inline' id='basic-setup-and-manual-code-prompting'>Basic Setup and Manual Code Prompting</h2><br /> +<br /> +<h3 style='display: inline' id='installing-ollama-and-a-model'>Installing Ollama and a Model</h3><br /> +<br /> +<span>To install Ollama, IIperformed these steps (this assumes that you have already installed Homebrew on your macOS system):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>brew install ollama +rehash +ollama serve +</pre> +<br /> +<span>Which started up the Ollama server with something like this (the screenshots shows already some requests made):</span><br /> +<br /> +<a href='./local-coding-LLM-with-ollama/ollama-serve.png'><img alt='Ollama serving' title='Ollama serving' src='./local-coding-LLM-with-ollama/ollama-serve.png' /></a><br /> +<br /> +<span>And then, in a new terminal, I pulled the model with:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>ollama pull qwen2.<font color="#000000">5</font>-coder:14b-instruct +</pre> +<br /> +<span>Now, I was ready to go! It wasn't so difficult. Now, let's see how I used this model for coding tasks.</span><br /> +<br /> +<h3 style='display: inline' id='example-usage'>Example Usage</h3><br /> +<br /> +<span>I run the following command to get a Go function for calculating Fibonacci numbers:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>time echo <font color="#808080">"Write a function in golang to print out the Nth fibonacci number, \</font> +<font color="#808080"> only the function without the boilerplate"</font> | ollama run qwen2.<font color="#000000">5</font>-coder:14b-instruct + +Output: + +func fibonacci(n int) int { + <b><u><font color="#000000">if</font></u></b> n <= <font color="#000000">1</font> { + <b><u><font color="#000000">return</font></u></b> n + } + a, b := <font color="#000000">0</font>, <font color="#000000">1</font> + <b><u><font color="#000000">for</font></u></b> i := <font color="#000000">2</font>; i <= n; i++ { + a, b = b, a+b + } + <b><u><font color="#000000">return</font></u></b> b +} + +Execution Metrics: + +Executed <b><u><font color="#000000">in</font></u></b> <font color="#000000">4.90</font> secs fish external + usr time <font color="#000000">15.54</font> millis <font color="#000000">0.31</font> millis <font color="#000000">15.24</font> millis + sys time <font color="#000000">19.68</font> millis <font color="#000000">1.02</font> millis <font color="#000000">18.66</font> millis +</pre> +<br /> +<span class='quote'>Note, after having written this blog post, I tried the same with the newer model <span class='inlinecode'>qwen3-coder:30b-a3b-q4_K_M</span> (which "just" came out, and it's a quantised 30B model), and it was much faster:</span><br /> +<br /> +<pre> +Executed in 1.83 secs fish external + usr time 17.82 millis 4.40 millis 13.42 millis + sys time 17.07 millis 1.57 millis 15.50 millis +</pre> +<br /> +<a class='textlink' href='https://ollama.com/library/qwen3-coder:30b-a3b-q4_K_M'>https://ollama.com/library/qwen3-coder:30b-a3b-q4_K_M</a><br /> +<br /> +<h2 style='display: inline' id='agentic-coding-with-aider'>Agentic Coding with Aider</h2><br /> +<br /> +<h3 style='display: inline' id='installation'>Installation</h3><br /> +<br /> +<span>Aider is a tool that enables agentic coding by leveraging AI models (also local ones, as in our case). While setting up OpenAI Codex and OpenCode with Ollama proved challenging (those tools either didn't know how to work with the "tools" (the capability to execute external commands or to edit files for example) or didn't connect at all to Ollama for some reason), Aider worked smoothly.</span><br /> +<br /> +<span>To get started, the only thing I had to do was to install it via Homebrew, initialise a Git repository, and then start Aider with the Ollama model <span class='inlinecode'>ollama_chat/qwen2.5-coder:14b-instruct</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>brew install aider +mkdir ~/git/aitest && cd ~/git/aitest && git init +aider --model ollama_chat/qwen<font color="#000000">2.5</font>-coder:14b-instruct +</pre> +<br /> +<a class='textlink' href='https://aider.chat'>https://aider.chat</a><br /> +<a class='textlink' href='https://opencode.ai'>https://opencode.ai</a><br /> +<a class='textlink' href='https://github.com/openai/codex'>https://github.com/openai/codex</a><br /> +<br /> +<h3 style='display: inline' id='agentic-coding-prompt'>Agentic coding prompt</h3><br /> +<br /> +<span>This is the prompt I gave:</span><br /> +<br /> +<pre> +Create a Go project with these files: + +* `cmd/aitest/main.go`: CLI entry point +* `internal/version.go`: Version information (0.0.0), should be printed when the + program was started with `-version` flag +* `internal/count.go`: File counting functionality, the program should print out + the number of files in a given subdirectory (the directory is provided as a + command line flag with `-dir`), if none flag is given, no counting should be + done +* `README.md`: Installation and usage instructions +</pre> +<br /> +<span>It then generated something, but did not work out of the box, as it had some issues with the imports and package names. So I had to do some follow-up prompts to fix those issues with something like this:</span><br /> +<br /> +<pre> +* Update import paths to match module name, github.com/yourname/aitest should be + aitest in main.go +* The package names of internal/count.go and internal/version.go should be + internal, and not count and version. +</pre> +<br /> +<a href='./local-coding-LLM-with-ollama/aider-fix-package.png'><img alt='Aider fixing the packages' title='Aider fixing the packages' src='./local-coding-LLM-with-ollama/aider-fix-package.png' /></a><br /> +<br /> +<h3 style='display: inline' id='compilation--execution'>Compilation & Execution</h3><br /> +<br /> +<span>Once done so, the project was ready and I could compile and run it:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>go build cmd/aitest/main.go +./main --help +./main -v +<font color="#000000">0.0</font>.<font color="#000000">0</font> +./main -dir . +Number of files <b><u><font color="#000000">in</font></u></b> directory .: <font color="#000000">4</font> +</pre> +<br /> +<h3 style='display: inline' id='the-code'>The code</h3><br /> +<br /> +<span>The code it generated was simple, but functional. The <span class='inlinecode'>./cmd/aitest/main.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> main + +<b><u><font color="#000000">import</font></u></b> ( + <font color="#808080">"flag"</font> + <font color="#808080">"fmt"</font> + <font color="#808080">"os"</font> + + <font color="#808080">"aitest/internal"</font> +) + +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> versionFlag <b><font color="#000000">bool</font></b> + flag.BoolVar(&versionFlag, <font color="#808080">"v"</font>, false, <font color="#808080">"print version"</font>) + dir := flag.String(<font color="#808080">"dir"</font>, <font color="#808080">""</font>, <font color="#808080">"directory to count files in"</font>) + flag.Parse() + + <b><u><font color="#000000">if</font></u></b> versionFlag { + fmt.Println(internal.GetVersion()) + <b><u><font color="#000000">return</font></u></b> + } + + <b><u><font color="#000000">if</font></u></b> *dir != <font color="#808080">""</font> { + fileCount, err := internal.CountFiles(*dir) + <b><u><font color="#000000">if</font></u></b> err != nil { + fmt.Fprintf(os.Stderr, <font color="#808080">"Error counting files: %v\n"</font>, err) + os.Exit(<font color="#000000">1</font>) + } + fmt.Printf(<font color="#808080">"Number of files in directory %s: %d\n"</font>, *dir, fileCount) + } <b><u><font color="#000000">else</font></u></b> { + fmt.Println(<font color="#808080">"No directory specified. No count given."</font>) + } +} +</pre> +<br /> +<span>The <span class='inlinecode'>./internal/version.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> internal + +<b><u><font color="#000000">var</font></u></b> Version = <font color="#808080">"0.0.0"</font> + +<b><u><font color="#000000">func</font></u></b> GetVersion() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> Version +} +</pre> +<br /> +<span>The <span class='inlinecode'>./internal/count.go</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> internal + +<b><u><font color="#000000">import</font></u></b> ( + <font color="#808080">"os"</font> +) + +<b><u><font color="#000000">func</font></u></b> CountFiles(dir <b><font color="#000000">string</font></b>) (int, error) { + files, err := os.ReadDir(dir) + <b><u><font color="#000000">if</font></u></b> err != nil { + <b><u><font color="#000000">return</font></u></b> <font color="#000000">0</font>, err + } + + count := <font color="#000000">0</font> + <b><u><font color="#000000">for</font></u></b> _, file := <b><u><font color="#000000">range</font></u></b> files { + <b><u><font color="#000000">if</font></u></b> !file.IsDir() { + count++ + } + } + + <b><u><font color="#000000">return</font></u></b> count, nil +} +</pre> +<br /> +<span>Etc...</span><br /> +<br /> +<span>The code is quite straightforward, especially for generating boilerplate code this will be useful for many use cases!</span><br /> +<br /> +<h2 style='display: inline' id='in-editor-code-completion'>In-Editor Code Completion</h2><br /> +<br /> +<span>To leverage Ollama for real-time code completion in my editor, I have integrated it with Helix, my preferred text editor. Helix supports the LSP (Language Server Protocol), which enables advanced code completion features. The <span class='inlinecode'>lsp-ai</span> is an LSP server that can interface with Ollama models for code completion tasks.</span><br /> +<br /> +<a class='textlink' href='https://github.com/SilasMarvin/lsp-ai'>https://github.com/SilasMarvin/lsp-ai</a><br /> +<br /> +<h3 style='display: inline' id='installation-of-lsp-ai'>Installation of <span class='inlinecode'>lsp-ai</span></h3><br /> +<br /> +<span>I installed <span class='inlinecode'>lsp-ai</span> via Rust's Cargo package manager. (If you don't have Rust installed, you can install it via Homebrew as well.):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>cargo install lsp-ai +</pre> +<br /> +<h3 style='display: inline' id='helix-configuration'>Helix Configuration</h3><br /> +<br /> +<span>I edited <span class='inlinecode'>~/.config/helix/languages.toml</span> to include:</span><br /> +<br /> +<pre> +<<language]] +name = "go" +auto-format= true +diagnostic-severity = "hint" +formatter = { command = "goimports" } +language-servers = [ "gopls", "golangci-lint-lsp", "lsp-ai", "gpt" ] +</pre> +<br /> +<span>Note that there is also a <span class='inlinecode'>gpt</span> language server configured, which is for GitHub Copilot, but it is out of scope of this blog post. Let's also configure <span class='inlinecode'>lsp-ai</span> settings in the same file:</span><br /> +<br /> +<pre> +[language-server.lsp-ai] +command = "lsp-ai" + +[language-server.lsp-ai.config.memory] +file_store = { } + +[language-server.lsp-ai.config.models.model1] +type = "ollama" +model = "qwen2.5-coder" + +[language-server.lsp-ai.config.models.model2] +type = "ollama" +model = "mistral-nemo:latest" + +[language-server.lsp-ai.config.models.model3] +type = "ollama" +model = "deepseek-r1:14b" + +[language-server.lsp-ai.config.completion] +model = "model1" + +[language-server.lsp-ai.config.completion.parameters] +max_tokens = 64 +max_context = 8096 + +## Configure the messages per your needs +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "system" +content = "Instructions:\n- You are an AI programming assistant.\n- Given a +piece of code with the cursor location marked by \"<CURSOR>\", replace +\"<CURSOR>\" with the correct code or comment.\n- First, think step-by-step.\n +- Describe your plan for what to build in pseudocode, written out in great +detail.\n- Then output the code replacing the \"<CURSOR>\"\n- Ensure that your +completion fits within the language context of the provided code snippet (e.g., +Go, Ruby, Bash, Java, Puppet DSL).\n\nRules:\n- Only respond with code or +comments.\n- Only replace \"<CURSOR>\"; do not include any previously written +code.\n- Never include \"<CURSOR>\" in your response\n- If the cursor is within +a comment, complete the comment meaningfully.\n- Handle ambiguous cases by +providing the most contextually appropriate completion.\n- Be consistent with +your responses." + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func greet(name) {\n print(f\"Hello, {<CURSOR>}\")\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "name" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func sum(a, b) {\n return a + <CURSOR>\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "b" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "func multiply(a, b int ) int {\n a * <CURSOR>\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "b" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "// <CURSOR>\nfunc add(a, b) {\n return a + b\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "Adds two numbers" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "// This function checks if a number is even\n<CURSOR>" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "assistant" +content = "func is_even(n) {\n return n % 2 == 0\n}" + +<<language-server.lsp-ai.config.completion.parameters.messages]] +role = "user" +content = "{CODE}" +</pre> +<br /> +<span>As you can see, I have also added other models, such as Mistral Nemo and DeepSeek R1, so that I can switch between them in Helix. Other than that, the completion parameters are interesting. They define how the LLM should interact with the text in the text editor based on the given examples.</span><br /> +<br /> +<h3 style='display: inline' id='code-completion-in-action'>Code completion in action</h3><br /> +<br /> +<span>The screenshot shows how Ollama's <span class='inlinecode'>qwen2.5-coder</span> model provides code completion suggestions within the Helix editor. The LSP auto-completion is triggered by typing <span class='inlinecode'><CURSOR></span> in the code snippet, and Ollama responds with relevant completions based on the context.</span><br /> +<br /> +<a href='./local-coding-LLM-with-ollama/helix-lsp-ai.png'><img alt='Completing the fib-function' title='Completing the fib-function' src='./local-coding-LLM-with-ollama/helix-lsp-ai.png' /></a><br /> +<br /> +<span>In the LSP auto-completion, the one prefixed with <span class='inlinecode'>ai - </span> was generated by <span class='inlinecode'>qwen2.5-coder</span>, the other ones are from other LSP servers (GitHub Copilot, Go linter, Go language server, etc.).</span><br /> +<br /> +<span>I found GitHub Copilot to be still faster than <span class='inlinecode'>qwen2.5-coder:14b</span>, but the local LLM one is actually workable for me already. And, as mentioned earlier, things will likely improve in the future regarding local LLMs. So I am excited about the future of local LLMs and coding tools like Ollama and Helix.</span><br /> +<br /> +<span>After trying <span class='inlinecode'>qwen3-coder:30b-a3b-q4_K_M</span> (following the publication of this blog post), I found it to be significantly faster and more capable than the previous model, making it a promising option for local coding tasks. Experimentation reveals that even current local setups are surprisingly effective for routine coding tasks, offering a glimpse into the future of on-machine AI assistance.</span><br /> +<br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> +<br /> +<span>Will there ever be a time we can run larger models (60B, 100B, ...and larger) on consumer hardware, or even on our phones? We are not quite there yet, but I am optimistic that we will see significant improvements in the next few years. As hardware capabilities improve and/or become cheaper, and more efficient models are developed, the landscape of local AI coding assistants will continue to evolve. </span><br /> +<br /> +<span>For now, even the models listed in this blog post are very promising already, and they run on consumer-grade hardware (at least in the realm of the initial tests I've performed... the ones in this blog post are overly simplistic, though! But they were good for getting started with Ollama and initial demonstration)! I will continue experimenting with Ollama and other local LLMs to see how they can enhance my coding experience. I may cancel my Copilot subscription, which I currently use only for in-editor auto-completion, at some point.</span><br /> +<br /> +<span>However, truth be told, I don't think the setup described in this blog post currently matches the performance of commercial models like Claude Code (Sonnet 4, Opus 4), Gemini 2.5 Pro, and others. Maybe we could get close if we had the high-end hardware needed to run the largest Qwen Coder model available. But, as mentioned already, that is out of reach for occasional coders like me. Furthermore, I want to continue coding manually to some degree, as otherwise I will start to forget how to write for-loops, which can be awkward... However, do we always need the best model when AI can help generate boilerplate or repetitive tasks even with smaller models?</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-08-05-local-coding-llm-with-ollama.html'>2025-08-05 Local LLM for Coding with Ollama (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-06-22-task-samurai.html'>2025-06-22 Task Samurai: An agentic coding learning experiment</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> <title>f3s: Kubernetes with FreeBSD - Part 6: Storage</title> <link href="https://foo.zone/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html" /> <id>https://foo.zone/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html</id> @@ -2736,7 +3186,7 @@ Jul <font color="#000000">06</font> <font color="#000000">10</font>:<font color= </ul><br /> <h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> -<span>Building Task Samurai with agentic coding was a wild ride—rapid feature growth, countless fast fixes, and more merge commits I'd expected. Keep the iterations short (or maybe in my next experiment, much larger, with better and more complete design before generating a single line of code), keep tests and documentation concise, and review and refine for final polish at the end. Even with the bumps along the way, shipping a polished terminal UI in days instead of weeks is a testament to the power of agentic development.</span><br /> +<span>Building Task Samurai with agentic coding was a wild ride—rapid feature growth, countless fast fixes, and more merge commits I'd expected. Keep the iterations short (or maybe in my next experiment, much larger, with better and more complete design before generating a single line of code), keep tests and documentation concise, and review and refine for final polish at the end. Even with the bumps along the way, shipping a terminal UI in days instead of weeks is a neat little showcase vibe coding.</span><br /> <br /> <span>Am I an agentic coding expert now? I don't think so. There are still many things to learn, and the landscape is constantly evolving.</span><br /> <br /> @@ -2748,6 +3198,11 @@ Jul <font color="#000000">06</font> <font color="#000000">10</font>:<font color= <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-08-05-local-coding-llm-with-ollama.html'>2025-08-05 Local LLM for Coding with Ollama</a><br /> +<a class='textlink' href='./2025-06-22-task-samurai.html'>2025-06-22 Task Samurai: An agentic coding learning experiment (You are currently reading this)</a><br /> +<br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -12566,195 +13021,4 @@ http://www.gnu.org/software/src-highlite --> </div> </content> </entry> - <entry> - <title>Unveiling `guprecords.raku`: Global Uptime Records with Raku</title> - <link href="https://foo.zone/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html" /> - <id>https://foo.zone/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html</id> - <updated>2023-04-30T13:10:26+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> -<br /> -<span class='quote'>Published at 2023-04-30T13:10:26+03:00</span><br /> -<br /> -<pre> -+-----+-----------------+-----------------------------+ -| Pos | Host | Lifespan | -+-----+-----------------+-----------------------------+ -| 1. | dionysus | 8 years, 6 months, 17 days | -| 2. | uranus | 7 years, 2 months, 16 days | -| 3. | alphacentauri | 6 years, 9 months, 13 days | -| 4. | *vulcan | 4 years, 5 months, 6 days | -| 5. | sun | 3 years, 10 months, 2 days | -| 6. | uugrn | 3 years, 5 months, 5 days | -| 7. | deltavega | 3 years, 1 months, 21 days | -| 8. | pluto | 2 years, 10 months, 30 days | -| 9. | tauceti | 2 years, 3 months, 22 days | -| 10. | callisto | 2 years, 3 months, 13 days | -+-----+-----------------+-----------------------------+ -</pre> -<br /> -<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> -<br /> -<ul> -<li><a href='#unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</a></li> -<li>⇢ <a href='#introduction'>Introduction</a></li> -<li>⇢ <a href='#how-guprecords-works'>How Guprecords works</a></li> -<li>⇢ <a href='#example'>Example</a></li> -<li>⇢ <a href='#conclusion'>Conclusion</a></li> -</ul><br /> -<h2 style='display: inline' id='introduction'>Introduction</h2><br /> -<br /> -<span>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</span><br /> -<br /> -<span>As a result of this, I am introducing <span class='inlinecode'>guprecords.raku</span>, a handy Raku script that helps me combine uptime statistics from multiple servers into one comprehensive report. In this blog post, I'll explore what Guprecords is and some examples of its application. I will also add some notes on Raku.</span><br /> -<br /> -<span>Guprecords, or global uptime records, is a Raku script designed to generate a consolidated uptime report from multiple hosts:</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/guprecords'>https://codeberg.org/snonux/guprecords</a><br /> -<a class='textlink' href='https://raku.org'>The Raku Programming Language</a><br /> -<br /> -<span>A previous version of Guprecords was actually written in Perl, the older and more established language from which Raku was developed. One of the primary motivations for rewriting Guprecords in Raku was to learn the language and explore its features. Raku is a more modern and powerful language compared to Perl, and working on a real-world project like Guprecords provided a practical and engaging way to learn the language.</span><br /> -<br /> -<span>Over the last years, I have been reading the following books and resources about Raku:</span><br /> -<br /> -<ul> -<li>Raku Guide (at raku.guide)</li> -<li>Think Perl 6</li> -<li>Raku Fundamentals</li> -<li>Raku Recipes</li> -</ul><br /> -<span>And I have been following the Raku newsletter, and sometimes I have been lurking around in the IRC channels, too. Watching Raku coding challenges on YouTube was pretty fun, too. However, nothing beats actually using Raku to learn the language. After reading all of these resources, I may have a good idea about the features and paradigms, but I am by far not an expert.</span><br /> -<br /> -<h2 style='display: inline' id='how-guprecords-works'>How Guprecords works</h2><br /> -<br /> -<span>Guprecords works in three stages:</span><br /> -<br /> -<ul> -<li>1. Generating uptime statistics using <span class='inlinecode'>uptimed</span>: First, I need to install and run <span class='inlinecode'>uptimed</span> on each host to generate uptime statistics. This tool is available for most common Linux and *BSD distributions and macOS via Homebrew.</li> -<li>2. Collecting uptime records to a central location: The next step involves collecting the raw uptime statistics files generated by <span class='inlinecode'>uptimed</span> on each host. It's a good idea to store all record files in a central git repository. The records file contains information about the total uptime since boot, boot time, and the operating system and kernel version. Guprecords itself does not do the collection part, but have a look at the <span class='inlinecode'>README.md</span> in the git repository for some guidance.</li> -<li>3. Generating global uptime stats: Finally, run the <span class='inlinecode'>guprecords.raku</span> script with the appropriate flags to create a global uptime report. For example, I can use the following command:</li> -</ul><br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre>$ raku guprecords.raku --stats=dir=$HOME/git/uprecords/stats --all -</pre> -<br /> -<span>This command will generate a comprehensive uptime report from the collected statistics, making it easy to review and enjoy the data.</span><br /> -<br /> -<span>Guprecords supports the following features:</span><br /> -<br /> -<ul> -<li>Supports multiple categories: Host, Kernel, KernelMajor, and KernelName</li> -<li>Supports multiple metrics: Boots, Uptime, Score, Downtime, and Lifespan</li> -<li>Output formats available: Plaintext, Markdown, and Gemtext</li> -<li>Provides top entries based on the specified limit</li> -</ul><br /> -<h2 style='display: inline' id='example'>Example</h2><br /> -<br /> -<span>You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:</span><br /> -<br /> -<pre> -Top 20 Uptime's by Host - -+-----+-----------------+-----------------------------+ -| Pos | Host | Uptime | -+-----+-----------------+-----------------------------+ -| 1. | *vulcan | 4 years, 5 months, 6 days | -| 2. | uranus | 3 years, 11 months, 21 days | -| 3. | sun | 3 years, 9 months, 26 days | -| 4. | uugrn | 3 years, 5 months, 5 days | -| 5. | deltavega | 3 years, 1 months, 21 days | -| 6. | pluto | 2 years, 10 months, 29 days | -| 7. | tauceti | 2 years, 3 months, 19 days | -| 8. | tauceti-f | 1 years, 9 months, 18 days | -| 9. | *ultramega15289 | 1 years, 8 months, 17 days | -| 10. | *earth | 1 years, 5 months, 22 days | -| 11. | *blowfish | 1 years, 4 months, 20 days | -| 12. | ultramega8477 | 1 years, 3 months, 25 days | -| 13. | host0 | 1 years, 3 months, 9 days | -| 14. | tauceti-e | 1 years, 2 months, 20 days | -| 15. | makemake | 1 years, 1 months, 6 days | -| 16. | callisto | 0 years, 10 months, 31 days | -| 17. | alphacentauri | 0 years, 10 months, 28 days | -| 18. | london | 0 years, 9 months, 16 days | -| 19. | twofish | 0 years, 8 months, 31 days | -| 20. | *fishfinger | 0 years, 8 months, 17 days | -+-----+-----------------+-----------------------------+ -</pre> -<br /> -<span>This table ranks the top 20 hosts based on their total uptime, with the host having the highest uptime at the top. The hosts marked with <span class='inlinecode'>*</span> are still active, means stats were collected within the last couple of months. </span><br /> -<br /> -<span>My up to date stats can be seen here:</span><br /> -<br /> -<a class='textlink' href='../uptime-stats.html'>My machine uptime stats</a><br /> -<br /> -<span>Just recently, I decommissioned <span class='inlinecode'>vulcan</span> (the number one stop from above), which used to be my CentOS 7 (initially CentOS 6) VM hosting my personal NextCloud and Wallabag (which I modernised just recently with a brand new shiny Rocky Linux 9 VM). This was the last <span class='inlinecode'>uptimed</span> output before shutting it down (it always makes me feel sentimental decommissioning one of my machines <span class='inlinecode'>:'-(</span>):</span><br /> -<br /> -<pre> - # Uptime | System Boot up -----------------------------+--------------------------------------------------- - 1 545 days, 17:58:15 | Linux 3.10.0-1160.15.2.e Sun Jul 25 19:32:25 2021 - 2 279 days, 10:12:14 | Linux 3.10.0-957.21.3.el Sun Jun 30 12:43:41 2019 - 3 161 days, 06:08:43 | Linux 3.10.0-1160.15.2.e Sun Feb 14 11:05:38 2021 - 4 107 days, 01:26:35 | Linux 3.10.0-957.1.3.el7 Thu Dec 20 09:29:13 2018 - 5 96 days, 21:13:49 | Linux 3.10.0-1127.13.1.e Sat Jul 25 17:56:22 2020 --> 6 89 days, 23:05:32 | Linux 3.10.0-1160.81.1.e Sun Jan 22 12:39:36 2023 - 7 63 days, 18:30:45 | Linux 3.10.0-957.10.1.el Sat Apr 27 18:12:43 2019 - 8 63 days, 06:53:33 | Linux 3.10.0-1127.8.2.el Sat May 23 10:41:08 2020 - 9 48 days, 11:44:49 | Linux 3.10.0-1062.18.1.e Sat Apr 4 22:56:07 2020 - 10 42 days, 08:00:13 | Linux 3.10.0-1127.19.1.e Sat Nov 7 11:47:33 2020 - 11 36 days, 22:57:19 | Linux 3.10.0-1160.6.1.el Sat Dec 19 19:47:57 2020 - 12 21 days, 06:16:28 | Linux 3.10.0-957.10.1.el Sat Apr 6 11:56:01 2019 - 13 12 days, 20:11:53 | Linux 3.10.0-1160.11.1.e Mon Jan 25 18:45:27 2021 - 14 7 days, 21:29:18 | Linux 3.10.0-1127.13.1.e Fri Oct 30 14:18:04 2020 - 15 6 days, 20:07:18 | Linux 3.10.0-1160.15.2.e Sun Feb 7 14:57:35 2021 - 16 1 day , 21:46:41 | Linux 3.10.0-957.1.3.el7 Tue Dec 18 11:42:19 2018 - 17 0 days, 01:25:57 | Linux 3.10.0-957.1.3.el7 Tue Dec 18 10:16:08 2018 - 18 0 days, 00:42:34 | Linux 3.10.0-1160.15.2.e Sun Jul 25 18:49:38 2021 - 19 0 days, 00:08:32 | Linux 3.10.0-1160.81.1.e Sun Jan 22 12:30:52 2023 -----------------------------+--------------------------------------------------- -1up in 6 days, 22:08:18 | at Sat Apr 29 10:53:25 2023 -no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 - up 1586 days, 00:20:28 | since Tue Dec 18 10:16:08 2018 - down 0 days, 01:08:32 | since Tue Dec 18 10:16:08 2018 - %up 99.997 | since Tue Dec 18 10:16:08 2018 -</pre> -<br /> -<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> -<br /> -<span>Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.</span><br /> -<br /> -<span>Raku's expressive syntax, support for multiple programming paradigms, and unique features, such as grammars and lazy evaluation, make it a joy to work with. </span><br /> -<br /> -<span>Working on Guprecords in Raku has been an enjoyable experience, and I've found that Raku's expressiveness has significantly contributed to the overall quality and effectiveness of the script. The language's ability to elegantly express complex logic and data manipulation tasks makes it an excellent choice for developing tools like these, where expressiveness and productiveness are of the utmost importance.</span><br /> -<br /> -<span>So far, I have only scratched the surface of what Raku can do. I hope to find more time to become a regular Rakoon (a Raku Programmer). I have many Ideas for other small tools like Guprecords, but the challenge is finding the time. I'd love to explore Raku Grammars and also I would love to explore writing concurrent code in Raku (I also love Go (Golang), btw!). Ideas for future Raku personal projects include:</span><br /> -<br /> -<ul> -<li>A log file analyzer, for generating anonymized <span class='inlinecode'>foo.zone</span> visitor stats for both, the Web and Gemini.</li> -<li>A social media sharing scheduler a la <span class='inlinecode'>buffer.com</span>. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.</li> -<li>Rewrite the static photo album generator of <span class='inlinecode'>irregular.ninja</span> in Raku (from Bash).</li> -</ul><br /> -<span>E-Mail your comments to hi@foo.zone :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>2023-05-01 Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>2022-06-15 Sweating the small stuff - Tiny projects of mine</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> </feed> diff --git a/gemfeed/index.html b/gemfeed/index.html index e8198020..bf35dc3c 100644 --- a/gemfeed/index.html +++ b/gemfeed/index.html @@ -15,6 +15,7 @@ <br /> <h2 style='display: inline' id='to-be-in-the-zone'>To be in the .zone!</h2><br /> <br /> +<a class='textlink' href='./2025-08-05-local-coding-llm-with-ollama.html'>2025-08-05 - Local LLM for Coding with Ollama</a><br /> <a class='textlink' href='./2025-07-14-f3s-kubernetes-with-freebsd-part-6.html'>2025-07-14 - f3s: Kubernetes with FreeBSD - Part 6: Storage</a><br /> <a class='textlink' href='./2025-07-01-posts-from-january-to-june-2025.html'>2025-07-01 - Posts from January to June 2025</a><br /> <a class='textlink' href='./2025-06-22-task-samurai.html'>2025-06-22 - Task Samurai: An agentic coding learning experiment</a><br /> diff --git a/gemfeed/local-coding-LLM-with-ollama/aider-fix-package.png b/gemfeed/local-coding-LLM-with-ollama/aider-fix-package.png Binary files differnew file mode 100644 index 00000000..58050aee --- /dev/null +++ b/gemfeed/local-coding-LLM-with-ollama/aider-fix-package.png diff --git a/gemfeed/local-coding-LLM-with-ollama/helix-lsp-ai.png b/gemfeed/local-coding-LLM-with-ollama/helix-lsp-ai.png Binary files differnew file mode 100644 index 00000000..24f3d936 --- /dev/null +++ b/gemfeed/local-coding-LLM-with-ollama/helix-lsp-ai.png diff --git a/gemfeed/local-coding-LLM-with-ollama/ollama-serve.png b/gemfeed/local-coding-LLM-with-ollama/ollama-serve.png Binary files differnew file mode 100644 index 00000000..01545bed --- /dev/null +++ b/gemfeed/local-coding-LLM-with-ollama/ollama-serve.png |
