Dot Net Perls Blog

RSS: https://dotnetperls.com/rss.xml
Dot Net Perls 提供 .NET 编程示例和教程。

Small Model Rampages and Safety

Now that I have an agentic AI system set up (I wrote my own local MCP server) I can test different models on it. However, it became clear in testing that occasionally a model will make a "bad" tool ca...
评论点赞收藏6 天前

在 Llama-cpp 中使用 ui-mcp-proxy 解决跨域问题

作者使用 Rust 编写的 MCP 服务器调用本地大语言模型时遭遇浏览器 CORS 错误,通过 llama-cpp 的 ui-mcp-proxy 参数将 MCP 服务与 llama-server 部署在同一台机器上,彻底解决跨域问题并移除 CORS 中间件代码。
评论点赞收藏21 天前

编写本地 MCP Server 让大模型调用自定义工具

作者用 Python 和 Rust 实现了本地 MCP Server,让 LLM 能可靠调用自定义工具。Gemma 4 12B 等模型可直接通过 HTTP JSON 接口触发如 create_archive 等操作,比纯文本指令更稳定,但需注意 CORS 问题。
评论点赞收藏22 天前

用 Laguna 在 Rust 中编写测试

作者使用 Laguna XS 结合 OpenCode 优化 Rust 测试用例。发现 AI 生成的单元测试往往过于狭窄,于是利用 AI 移除大量细碎测试,替换为一个覆盖多个函数的通用测试。结果测试数量减少但覆盖率提升,维护成本降低且代码更整洁。作者认为这是 Agentic AI 辅助工程实践的一个有效案例。
评论点赞收藏24 天前

在 OpenCode 中使用 Laguna XS 模型

Poolside AI 发布的 Laguna XS 小模型已支持 llama-cpp,作者在本地使用 OpenCode 对该模型进行代码重构测试。相比 Qwen 3.6 35B、Gemma 4 等开源模型,Laguna XS 在针对性修改任务中表现更佳,但在开放优化任务上仍有局限。
评论点赞收藏25 天前

用 AI Markdown 文件替代脚本

提出用 Markdown 文件配合本地 AI Agent(如 llama-cpp)替代传统 Bash 脚本的想法,声称自然语言指令更易维护。但也指出低质模型执行不准及文件本身仍具维护负担的问题。
评论点赞收藏26 天前

实测 Kimi K3 编程能力

本周,全新模型Kimi K3正式发布,据称其质量已接近前沿级别,与Fable和GPT不相上下。 我决定试用一下,看看它是否能优化我的Rust程序。 我觉得,像“以某种方式优化这个函数”这样不够具体的任务,其实是个不错的测试方式。 Kimi K3 我在OpenCode中设置了Kimi K3,并复制了一份自己的程序目录,这样就能轻松地将所做的修改全部丢弃。 我向想要优化的函数发出了提示。我花了相当...
评论点赞收藏26 天前

利用 AI 重写代码:从直接操作到生成脚本的实战反思

作者尝试用 AI 代理直接重写 Rust 代码库中的注释,发现大文件处理容易出错。最终改为让 LLM 生成 Python 脚本进行批量处理,效果更可靠且速度更快。这一实战经验表明,让 AI 编写脚本来操作代码,比直接让 AI 重写代码更具实用价值。
评论点赞收藏34 天前

使用 llama-cpp 进行本地代码开发

针对本地大模型代码助手(如 OpenCode)在中等配置显卡上运行缓慢的问题,作者通过实验发现直接使用 llama-cpp 配合内置工具(edit file, read file)能显著减少 Prompt 大小,从而提升速度并降低系统内存占用(避免了加载整个 JavaScript 运行时)。虽然这种方式要求用户手动管理项目信息文件,且智能体的意图猜测能力稍弱,但对于硬件资源有限的开发者来说,这是一种可行的替代方案。
评论点赞收藏36 天前

在 llama.cpp 中使用工具调用功能

作者演示了如何在 llama.cpp 中启用 Tool Calls,让本地大模型(如 Gemma、Qwen)具备读取文件或执行系统调用的能力。通过将指令写入 Markdown 文件并让模型读取,实现了类似 Bash 脚本但更易维护的代码编辑流程。
评论点赞收藏39 天前

MTP、EAGLE-3 与 DFlash 推测解码调优笔记

作者在 RTX 3060 上测试 MTP、EAGLE-3 和 DFlash 等推测解码技术,发现对 Qwen 35B 等大模型,将 spec-draft-n-max 设为 1 比设更高值更有效。实测 DFlash 略快于 EAGLE-3,推测解码使代码模型生成速度从 24 提升至 39 tokens/s,提升 38%。建议消费级显卡用户减少推测量并使用更小的推测模型。
评论点赞收藏40 天前

DFlash:利用扩散模型加速本地 LLM 推理

Z-Lab 提出 DFlash,利用扩散模型推测下一个 token 来加速本地 LLM 推理。实测 Qwen 3 8B 在 llama-cpp 中生成代码速度从 58 提升至 123 tokens/s,但其他文本类型提升有限。该方法适合显存未满的场景,旨在让已适配 GPU 的快速模型进一步提速。
评论点赞收藏45 天前

Why Local LLMs Are Necessary

Currently it is not feasible (for most people) to run frontier, state-of-the-art models (LLMs) locally. Data centers are needed to run these large models. However, I remain convinced that local LLMs a...
评论点赞收藏50 天前

Agentic Coding Outperforms Human

I spent an hour trying to improve a function in my Rust program. Unfortunately, after all my work, it turned out my changes made it slower, so I had to discard the new version. In dismay, I loaded a l...
评论点赞收藏53 天前

AutoRound Quantization for LLMs

When an LLM is quantized, it becomes possible to fit it onto a consumer GPU. Quantization is an important step in getting an LLM to work on many GPUs. Recently I investigated the AutoRound quantizatio...
评论点赞收藏54 天前

ComfyUI Optimal Settings

Recently I have been using ComfyUI to generate desktop backgrounds for my Ubuntu system. I have an Nvidia GPU (RTX 3060 12 GB) so I have been able to do it entirely locally. It took me a while to figu...
评论点赞收藏55 天前

Will Coding Become Obsolete

There is ongoing hype about how AI will replace manual coding. For example Elon Musk stated about a week ago that "things will move maybe even by the end of this year to where you don't even bother do...
评论点赞收藏58 天前

Sometimes No Code Is Best

Yesterday I decided I needed a new function in my Rust program. I used 3 different LLMs in OpenCode to try to generate this method. The first model I used (a local model) seemed to have problems and c...
评论点赞收藏60 天前

North Mini Code First Results

Recently Cohere AI released an open-weights coding model called North Mini Code. This Mixture-of-Experts coding model has 30 billion parameters and 3 billion active parameters. I downloaded a 4-bit qu...
评论点赞收藏61 天前

Refreshing Skills and AI

Some days I like to make some code changes to make my program faster or more reliable. This also helps me keep my programming skills refreshed —I don't want to forget anything important. Today I revie...
评论点赞收藏62 天前

Pi Code with Gemma 4 QAT

The agentic coding I have done so far has been with OpenCode, but I have been hearing about Pi Code so today I tried it out. It seems somewhat lighter than OpenCode. I thought maybe the Gemma 4 12B QA...
评论点赞收藏65 天前

登录芦苇

登录后关注作者、收藏内容和参与讨论。