<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: EladSer</title>
    <description>The latest articles on DEV Community by EladSer (@eladser).</description>
    <link>https://dev.to/eladser</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3972395%2Ff4959b4c-d14d-4f29-adb5-e5fc59b61f25.png</url>
      <title>DEV Community: EladSer</title>
      <link>https://dev.to/eladser</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eladser"/>
    <language>en</language>
    <item>
      <title>Dapper queries in an ASP.NET Core debug dashboard, without wrapping your connections</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Wed, 02 Dec 2026 00:08:27 +0000</pubDate>
      <link>https://dev.to/eladser/dapper-queries-in-an-aspnet-core-debug-dashboard-without-wrapping-your-connections-33dj</link>
      <guid>https://dev.to/eladser/dapper-queries-in-an-aspnet-core-debug-dashboard-without-wrapping-your-connections-33dj</guid>
      <description>&lt;p&gt;AspNetDebugDashboard is my take on Laravel Telescope for ASP.NET Core. One NuGet package, and in Development you get a page at &lt;code&gt;/_debug&lt;/code&gt; with every request your app handled: its SQL queries on a timeline, outgoing &lt;code&gt;HttpClient&lt;/code&gt; calls, logs and exceptions.&lt;/p&gt;

&lt;p&gt;Until this week the SQL part only saw EF Core, through a &lt;code&gt;DbCommandInterceptor&lt;/code&gt;. Dapper and plain ADO.NET queries never showed up, and plenty of apps run their hot paths on Dapper. 2.6 and 2.7 close that gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing to set up
&lt;/h2&gt;

&lt;p&gt;The drivers already report their commands, so the dashboard listens instead of asking you to wrap anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SqlConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// or NpgsqlConnection, MySqlConnection&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;QueryAsync&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"select * from Orders where CustomerId = @id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SqlClient publishes every command as a &lt;code&gt;DiagnosticListener&lt;/code&gt; event, the same mechanism the dashboard already uses to see every &lt;code&gt;HttpClient&lt;/code&gt; call, and those events carry the full command, parameters included. Npgsql and MySqlConnector report each command as a trace span instead. The span has the SQL and the timing but no parameter values, and it runs until the reader is closed, so on Postgres and MySQL the time includes reading the rows.&lt;/p&gt;

&lt;p&gt;The catch is EF Core: it runs on the same drivers, so its commands show up there too. Left alone, every EF query would be recorded twice. For SqlClient the EF interceptor claims each command right before it runs and the listener skips claimed ones. Spans carry no command to claim, so for Npgsql and MySqlConnector the dashboard skips spans that start in a request while one of EF's commands is running. The cost is that a Dapper query running at the very same moment as an EF query in the same request gets skipped too.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you want more
&lt;/h2&gt;

&lt;p&gt;SQLite reports nothing, and on Postgres or MySQL you might want the parameter values. For those there's one call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NpgsqlConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WithDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The wrapper records each command with its parameters and rows affected. When the dashboard isn't active, which by default means anywhere but Development, it hands back the connection you gave it, so the call can stay in production code. It's a plain &lt;code&gt;DbConnection&lt;/code&gt;, though, so code that casts it back to &lt;code&gt;NpgsqlConnection&lt;/code&gt; (binary import, say) needs the original.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same timeline, same N+1 check
&lt;/h2&gt;

&lt;p&gt;Dapper queries go on the request timeline like EF's, and the repeated-query check works on them too. The sample app has a Dapper version of its N+1 report, one query per order:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftpuzzf0wjnfrtfbxk4z5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftpuzzf0wjnfrtfbxk4z5.png" alt="Dapper N+1 on the timeline" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since all of this rides on events I don't control, CI now starts a real SQL Server and a real Postgres on every build and checks, on .NET 8, 10 and 11, that Dapper queries come through and EF queries are recorded exactly once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aspire
&lt;/h2&gt;

&lt;p&gt;If you run your app from an Aspire AppHost, a small new package adds a link to the dashboard in Aspire's resource list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddProject&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Api&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WithDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without the package, the address is logged at startup (&lt;code&gt;Debug dashboard: http://localhost:5000/_debug&lt;/code&gt;), and Aspire's console view turns that line into a link.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package AspNetDebugDashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;UseDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;code&gt;/_debug&lt;/code&gt;. Everything stays in a local LiteDB file. It's MIT and runs on .NET 8 through 11.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eladser/AspNetDebugDashboard" rel="noopener noreferrer"&gt;https://github.com/eladser/AspNetDebugDashboard&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release notes: &lt;a href="https://github.com/eladser/AspNetDebugDashboard/releases/tag/v2.7.0" rel="noopener noreferrer"&gt;https://github.com/eladser/AspNetDebugDashboard/releases/tag/v2.7.0&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dotnet</category>
      <category>aspnetcore</category>
      <category>csharp</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How much context still fits on your GPU? mtop 1.7 works it out</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Wed, 02 Dec 2026 00:07:15 +0000</pubDate>
      <link>https://dev.to/eladser/how-much-context-still-fits-on-your-gpu-mtop-17-works-it-out-55ap</link>
      <guid>https://dev.to/eladser/how-much-context-still-fits-on-your-gpu-mtop-17-works-it-out-55ap</guid>
      <description>&lt;p&gt;mtop is a terminal view for local model servers: the models you have loaded and the VRAM they hold, the GPU, and the requests going through with their tok/s. It works with Ollama, llama.cpp, LM Studio, vLLM, Lemonade and SGLang.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3jvypfexszvkdlk254d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3jvypfexszvkdlk254d.gif" alt="mtop demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How much context fits
&lt;/h2&gt;

&lt;p&gt;Ollama picks the context size from your total VRAM: 4k on cards under 23 GB, 32k up to 47 GB, 256k above. So on a 12 or 16 GB card you're probably running 4k without knowing it, often with room for a lot more. And when you go the other way and raise &lt;code&gt;num_ctx&lt;/code&gt; too far, Ollama doesn't shrink it to fit. It moves layers to the CPU, and from then on every token waits on system RAM.&lt;/p&gt;

&lt;p&gt;1.7 puts a line under the models table for the selected Ollama model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ctx 4k · up to 22k fits on GPU
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the whole trained context fits, it says &lt;code&gt;full 40k fits on GPU&lt;/code&gt;. And the CPU warning from 1.6 now tells you what to set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;↳ 38% of model on CPU · fits at ctx 16k
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload with &lt;code&gt;num_ctx&lt;/code&gt; 16384 (or &lt;code&gt;OLLAMA_CONTEXT_LENGTH&lt;/code&gt;) and it's all on the GPU again. If no context would be small enough, because the weights themselves don't fit next to whatever else is loaded, it says &lt;code&gt;GPU too full&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the number comes from
&lt;/h2&gt;

&lt;p&gt;Each token of context costs a fixed amount of KV cache, and Ollama's &lt;code&gt;/api/show&lt;/code&gt; hands over everything needed to work it out: layer count, KV heads, head size. For qwen3:0.6b that's 112 KiB per token, which is exactly what Ollama's own log prints when it allocates the cache. Sliding-window models (gemma, gpt-oss), MLA (DeepSeek) and hybrid models with recurrent layers are counted the way llama.cpp actually allocates them, since their cache doesn't grow on every layer.&lt;/p&gt;

&lt;p&gt;mtop takes the free VRAM right now, keeps the 1 GB margin llama.cpp leaves when it places layers, subtracts whatever already spilled to CPU, and divides by the per-token cost. I checked it on a 5090 by forcing a model 24% onto the CPU: mtop said &lt;code&gt;fits at ctx 29k&lt;/code&gt;, I reloaded at 29k, and it was back on the GPU. It errs low. On Windows the driver also evicts other apps' VRAM when it has to, so there's usually a bit more room than it says.&lt;/p&gt;

&lt;p&gt;Ollama doesn't report its KV cache type or how many parallel slots it runs, so mtop reads &lt;code&gt;OLLAMA_KV_CACHE_TYPE&lt;/code&gt; and &lt;code&gt;OLLAMA_NUM_PARALLEL&lt;/code&gt; from its own environment. If your Ollama runs with different values (a systemd unit, say), the number is off by that factor. llama.cpp, LM Studio and vLLM rows don't get a fit yet, since they don't expose the layer shapes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;mtop --demo&lt;/code&gt; runs on a simulated 16 GB card with a qwen3:8b pushed to its full 40k context and spilling to CPU, so you can see the lines without a server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew install eladser/tap/mtop
scoop install mtop
winget install eladser.mtop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Single Go binary, MIT.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eladser/mtop" rel="noopener noreferrer"&gt;https://github.com/eladser/mtop&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release notes: &lt;a href="https://github.com/eladser/mtop/releases/tag/v1.7.0" rel="noopener noreferrer"&gt;https://github.com/eladser/mtop/releases/tag/v1.7.0&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>ollama</category>
      <category>opensource</category>
      <category>go</category>
    </item>
    <item>
      <title>Diffing two runs of the same AI agent</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Tue, 01 Dec 2026 16:02:38 +0000</pubDate>
      <link>https://dev.to/eladser/diffing-two-runs-of-the-same-ai-agent-4a41</link>
      <guid>https://dev.to/eladser/diffing-two-runs-of-the-same-ai-agent-4a41</guid>
      <description>&lt;p&gt;When an agent's answers get worse, or its bill goes up, the question is always the same: what changed between the run that was fine and this one? I kept answering it by opening two traces side by side and scrolling. Seerlens 1.6 does that part for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1qcr3ftajyumber4sl5d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1qcr3ftajyumber4sl5d.gif" alt="Diffing two runs of the same agent" width="759" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Seerlens is a local collector and dashboard for LLM calls. Your app sends OpenTelemetry GenAI spans to it (from Python, JS, .NET or anything else with an OTel exporter), and it keeps them in a SQLite file on your machine. No account, nothing leaves your laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run diff
&lt;/h2&gt;

&lt;p&gt;Pick two runs in the trace list and Seerlens lines them up step by step. Model calls match model calls and tool calls match tool calls, even if one run swapped the model, so you see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which tool calls were added or dropped&lt;/li&gt;
&lt;li&gt;the prompt diff, word by word&lt;/li&gt;
&lt;li&gt;tokens, cost and latency for each step and in total&lt;/li&gt;
&lt;li&gt;a model change on a step, shown as &lt;code&gt;gpt-4o → gpt-4o-mini&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8yhnkz9rwxj7s6j3a1oz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8yhnkz9rwxj7s6j3a1oz.png" alt="Run diff" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same view works for evals. When a golden-set case fails, "What changed" opens a diff of that case against the last run where it passed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it really cost
&lt;/h2&gt;

&lt;p&gt;Prompt caching and reasoning tokens make naive token math wrong. Seerlens reads cached input (reads and writes) and reasoning tokens from the spans, prices them per model, and shows the cache hit rate per call, per trace and per model. It accepts the attribute names the OTel semconv, OpenLLMetry and the Vercel AI SDK actually emit, since those don't agree yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failing CI on cost
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;seerlens eval&lt;/code&gt; already failed a build when the eval score dropped. It can now fail on cost too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;seerlens &lt;span class="nb"&gt;eval&lt;/span&gt; support --min 0.8 --baseline .seerlens/support.base --max-cost-increase 0.25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That fails when a run costs more than 25% over the saved baseline, which is how a "small" model or prompt change that doubles your spend gets caught before it ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;

&lt;p&gt;Grab the self-contained build for your OS from the releases page and run &lt;code&gt;seerlens&lt;/code&gt;, or with the .NET 10 runtime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet tool install -g Seerlens
seerlens
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point any OTLP exporter at &lt;code&gt;http://localhost:5005/v1/traces&lt;/code&gt;. The README has copy-paste setups for Python (the OpenTelemetry OpenAI instrumentation), JS (the Vercel AI SDK) and .NET, and I ran each one against the collector before writing them down.&lt;/p&gt;

&lt;p&gt;Some limits: it's a local dev tool with no auth, cost for cached and reasoning tokens depends on how your exporter counts them (the README lists the cases it can't tell apart), and LLM output differs every run, so most model steps show up as changed. The tool path and totals are usually where the answer is.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eladser/seerlens" rel="noopener noreferrer"&gt;https://github.com/eladser/seerlens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release notes: &lt;a href="https://github.com/eladser/seerlens/releases/tag/v1.6.0" rel="noopener noreferrer"&gt;https://github.com/eladser/seerlens/releases/tag/v1.6.0&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>opentelemetry</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
    <item>
      <title>Why is my local model slow? mtop 1.6 tries to tell you</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Tue, 17 Nov 2026 12:34:14 +0000</pubDate>
      <link>https://dev.to/eladser/why-is-my-local-model-slow-mtop-16-tries-to-tell-you-2cnc</link>
      <guid>https://dev.to/eladser/why-is-my-local-model-slow-mtop-16-tries-to-tell-you-2cnc</guid>
      <description>&lt;p&gt;mtop is a terminal view for local model servers. One window shows the models you have loaded and the VRAM they hold, the GPU, and the requests going through with their tok/s. It works with Ollama, llama.cpp (including router mode and llama-swap), LM Studio, vLLM, Lemonade and SGLang.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3jvypfexszvkdlk254d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3jvypfexszvkdlk254d.gif" alt="mtop demo" width="720" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Requests while they stream
&lt;/h2&gt;

&lt;p&gt;Until now a request only showed up once it finished. In 1.6 it appears at the top of the requests pane as soon as it starts, with how long it's been going, tokens so far and a live tok/s. At 100 columns you also get time to first token and decode time, which is usually where the answer to "why did that feel slow" is.&lt;/p&gt;

&lt;p&gt;For streamed OpenAI-style requests the final tok/s is now decode only. If llama.cpp sends its own &lt;code&gt;predicted_per_second&lt;/code&gt;, mtop uses that. Otherwise it counts from the first token, so prompt processing and model loading don't drag the number down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Naming the reason
&lt;/h2&gt;

&lt;p&gt;The part I wanted most: when a model is slow and mtop can tell why, it says so under the models table.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;38% of model on CPU&lt;/code&gt;: part of the model didn't fit in VRAM and runs from system RAM.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;context 94% full&lt;/code&gt; or &lt;code&gt;prompt cut to fit context&lt;/code&gt;: ollama quietly drops the start of a prompt that doesn't fit, which is easy to miss.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3 requests queued&lt;/code&gt;: more requests than the server has slots (llama.cpp, vLLM and SGLang report this; ollama doesn't).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If an NVIDIA card is throttling itself for heat or power, the GPU pane shows that too, but only after it holds for a few polls with the card actually busy, so normal laptop power management doesn't set it off.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it without a server
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;mtop --demo&lt;/code&gt; plays a 40-second loop on simulated models, traffic and a GPU. It opens no port and doesn't talk to any server, so it's a quick way to see whether the tool is useful to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the numbers get there
&lt;/h2&gt;

&lt;p&gt;Most local servers don't expose per-request numbers anywhere, so mtop runs a small pass-through proxy on 127.0.0.1:4321 and reads them off the stream. Point your client at it (&lt;code&gt;OLLAMA_HOST=127.0.0.1:4321&lt;/code&gt;, or &lt;code&gt;base_url = "http://127.0.0.1:4321/v1"&lt;/code&gt;) and it gets the same bytes back. The models and GPU panes work without the proxy.&lt;/p&gt;

&lt;p&gt;One llama.cpp detail: mtop never polls &lt;code&gt;/slots&lt;/code&gt;, because that counts as activity and keeps a server started with &lt;code&gt;--sleep-idle-seconds&lt;/code&gt; from sleeping.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install eladser/tap/mtop
scoop install mtop
winget install eladser.mtop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or grab a binary from the releases page. It's a single Go binary, MIT licensed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/eladser/mtop" rel="noopener noreferrer"&gt;https://github.com/eladser/mtop&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release notes: &lt;a href="https://github.com/eladser/mtop/releases/tag/v1.6.0" rel="noopener noreferrer"&gt;https://github.com/eladser/mtop/releases/tag/v1.6.0&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>ollama</category>
      <category>opensource</category>
      <category>go</category>
    </item>
    <item>
      <title>An N+1 query looks like a staircase</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Tue, 17 Nov 2026 05:58:20 +0000</pubDate>
      <link>https://dev.to/eladser/an-n1-query-looks-like-a-staircase-54pi</link>
      <guid>https://dev.to/eladser/an-n1-query-looks-like-a-staircase-54pi</guid>
      <description>&lt;p&gt;I've been building AspNetDebugDashboard on and off for a while. It's my take on Laravel Telescope for ASP.NET Core: you add one NuGet package, and in Development you get a page at &lt;code&gt;/_debug&lt;/code&gt; with every request your app handled, the EF Core queries each one ran, outgoing &lt;code&gt;HttpClient&lt;/code&gt; calls, logs and exceptions.&lt;/p&gt;

&lt;p&gt;The part that always bugged me was the request detail. You'd open a slow request and get tabs. 21 queries in one of them, an HTTP call in another, 393 ms at the top, and adding it up was on you. So in 2.5 the detail opens on a timeline instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Feladser%2FAspNetDebugDashboard%2Fmain%2Fdocs%2Fimages%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Feladser%2FAspNetDebugDashboard%2Fmain%2Fdocs%2Fimages%2Fdemo.gif" alt="Demo" width="760" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sample app has a report endpoint I wrote to be slow on purpose. It loads 20 orders, fetches each order's items in a loop, and then calls a shipping-rates service that takes 300 ms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OrderItems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OrderItems&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OrderId&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToListAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1fypr1eaudrnsw02vhs1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1fypr1eaudrnsw02vhs1.png" alt="Timeline" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each bar starts where the query or call really started. The 20 item queries run one after another, so they step down the page, and since it's the same SQL every time they get grouped as &lt;code&gt;×20&lt;/code&gt;. The HTTP call doesn't start until they're all done. The line on top adds it up: 85 ms of SQL, 302 ms of HTTP, about 6 ms of everything else.&lt;/p&gt;

&lt;p&gt;About those 85 ms. The sample uses SQLite, which runs in-process, and there an N+1 costs next to nothing. I added a 4 ms delay to every command so it behaves like a database on the other side of a network. Your numbers will be whatever your database gives you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replay
&lt;/h2&gt;

&lt;p&gt;Next to copy-as-cURL there's a Replay button now. It opens the request with the method, path, headers and body filled in, you change whatever you want, and it sends it again from the browser. The new request gets captured like any other and shows up next to the original.&lt;/p&gt;

&lt;p&gt;The report endpoint takes a &lt;code&gt;?batched=true&lt;/code&gt; switch that loads everything with one &lt;code&gt;Include&lt;/code&gt; and reuses the shipping rates from the previous call. I added it to the path and hit send:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffslpfuv5il5fchpk8b5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffslpfuv5il5fchpk8b5i.png" alt="Replay" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;393 ms down to 6, and 21 queries down to 1. To be fair to the numbers, most of that time is the skipped HTTP call. The batching is where the 20 queries went.&lt;/p&gt;

&lt;p&gt;Replay can't send what it never stored. Authorization isn't captured by default, so you paste it back in yourself, and a browser won't let a page set Host or Origin. Razor form posts usually come back 400 because the antiforgery token gets redacted along with anything else named "token". The troubleshooting doc has the full list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package AspNetDebugDashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddDbContext&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppDbContext&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;UseSqlServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;UseDebugDashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;code&gt;/_debug&lt;/code&gt;. Everything stays in a local LiteDB file, and it only turns on in Development unless you say otherwise. It runs on .NET 8 through 11. It's meant for your own machine while you work. For production you still want an APM, and if a request crosses several services, Aspire's dashboard handles that much better.&lt;/p&gt;

&lt;p&gt;If you use a coding agent, a separate MCP package lets it read the same data, and as of 2.5 that includes the timings.&lt;/p&gt;

&lt;p&gt;Code and issues: &lt;a href="https://github.com/eladser/AspNetDebugDashboard" rel="noopener noreferrer"&gt;https://github.com/eladser/AspNetDebugDashboard&lt;/a&gt;&lt;br&gt;
NuGet: &lt;a href="https://www.nuget.org/packages/AspNetDebugDashboard" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/AspNetDebugDashboard&lt;/a&gt;&lt;br&gt;
Release notes: &lt;a href="https://github.com/eladser/AspNetDebugDashboard/releases/tag/v2.5.0" rel="noopener noreferrer"&gt;https://github.com/eladser/AspNetDebugDashboard/releases/tag/v2.5.0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>aspnetcore</category>
      <category>csharp</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Don't mutate CommandText in an EF Core interceptor (a mistake I shipped)</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Sat, 13 Jun 2026 07:58:25 +0000</pubDate>
      <link>https://dev.to/eladser/dont-mutate-commandtext-in-an-ef-core-interceptor-a-mistake-i-shipped-51o5</link>
      <guid>https://dev.to/eladser/dont-mutate-commandtext-in-an-ef-core-interceptor-a-mistake-i-shipped-51o5</guid>
      <description>&lt;p&gt;For about a year, my debugging tool crashed the instant anyone pointed it at SQLite. I had no idea, because I only ever ran it against SQL Server. Nobody opened an issue either, which tells you roughly how many people were using it. Here's the bug, because it's an easy one to ship and I doubt I'm alone.&lt;/p&gt;

&lt;p&gt;The tool records the SQL that EF Core runs (among other things) and shows it in a dashboard. To do that it uses a &lt;code&gt;DbCommandInterceptor&lt;/code&gt;, and I wanted each query's execution time. The way I got it was bad enough that I'll just show you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="n"&gt;InterceptionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DbDataReader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ReaderExecuting&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;DbCommand&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CommandEventData&lt;/span&gt; &lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InterceptionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DbDataReader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;NewGuid&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommandText&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;$" /* &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UtcNow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Ticks&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; */"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the way in, glue a comment with an id and a timestamp onto the SQL. On the way out, in &lt;code&gt;ReaderExecuted&lt;/code&gt;, parse that comment back off the command text and subtract to get the elapsed time. A little correlation system, smuggled through the query string.&lt;/p&gt;

&lt;p&gt;Yeah.&lt;/p&gt;

&lt;p&gt;The first problem is that this changes the SQL you send to the database. Every query left with a &lt;code&gt;/* ... */&lt;/code&gt; tail on it. SQL Server shrugs and runs it, which is the whole reason I never noticed, but now the database's own query logging is full of my garbage and I'm writing to something that isn't mine to write to.&lt;/p&gt;

&lt;p&gt;The second problem is the one that actually broke. Rewriting &lt;code&gt;CommandText&lt;/code&gt; after the command has run, while its reader is still open, throws on SQLite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.InvalidOperationException: An open reader is associated with this
command. Close it before changing the CommandText property.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SQLite in local dev is completely normal. So instead of a dashboard, those people got an exception thrown from inside the tool that was supposed to be helping them debug. Great look.&lt;/p&gt;

&lt;p&gt;Now the part that stings. I built that whole id-in-a-comment contraption to carry one number from &lt;code&gt;ReaderExecuting&lt;/code&gt; to &lt;code&gt;ReaderExecuted&lt;/code&gt;. I never needed to. &lt;code&gt;ReaderExecuted&lt;/code&gt; already hands you the duration, and the command, and everything else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="n"&gt;DbDataReader&lt;/span&gt; &lt;span class="nf"&gt;ReaderExecuted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;DbCommand&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CommandExecutedEventData&lt;/span&gt; &lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DbDataReader&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;Record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommandText&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CommandExecutedEventData.Duration&lt;/code&gt; is a &lt;code&gt;TimeSpan&lt;/code&gt; that EF measured for me. The command is right there too. There was nothing to correlate, because both halves of what I wanted live in the same callback. I'd written a solution to a problem the API had already solved, and that solution happened to corrupt SQL and crash SQLite on its way past.&lt;/p&gt;

&lt;p&gt;If you genuinely do need to carry state from executing to executed (something that's only available before the command runs, say), there's a stable handle for that too. &lt;code&gt;eventData.CommandId&lt;/code&gt; is the same &lt;code&gt;Guid&lt;/code&gt; across both calls. Key your own dictionary off it and leave the SQL alone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;ConcurrentDictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MyState&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_inflight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="n"&gt;InterceptionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DbDataReader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ReaderExecuting&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;DbCommand&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CommandEventData&lt;/span&gt; &lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InterceptionResult&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DbDataReader&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_inflight&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommandId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;CaptureWhateverYouNeed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="n"&gt;DbDataReader&lt;/span&gt; &lt;span class="nf"&gt;ReaderExecuted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;DbCommand&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CommandExecutedEventData&lt;/span&gt; &lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DbDataReader&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_inflight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TryRemove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eventData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommandId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;out&lt;/span&gt; &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// use state + eventData.Duration here&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command object is for reading. Whatever you want to stash, stash it on your side.&lt;/p&gt;

&lt;p&gt;I rebuilt the tool around the boring one-liner and shipped 2.0. MIT, .NET 8/9/10, two lines to wire up, then you open &lt;code&gt;/_debug&lt;/code&gt; and get your requests, the SQL with real parameter values, logs, exceptions, and an N+1 nag when one request fires the same query over and over. Demo gif and setup in the readme: &lt;a href="https://github.com/eladser/AspNetDebugDashboard" rel="noopener noreferrer"&gt;https://github.com/eladser/AspNetDebugDashboard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you write interceptors, go look at yours and make sure they're not doing something clever to the command text. Mine looked fine for a year.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I built a local Network tab for LLM calls (with evals), in .NET</title>
      <dc:creator>EladSer</dc:creator>
      <pubDate>Sun, 07 Jun 2026 10:47:13 +0000</pubDate>
      <link>https://dev.to/eladser/i-built-a-local-network-tab-for-llm-calls-with-evals-in-net-4b2h</link>
      <guid>https://dev.to/eladser/i-built-a-local-network-tab-for-llm-calls-with-evals-in-net-4b2h</guid>
      <description>&lt;p&gt;When you build something on top of an LLM, you mostly fly blind. You send a prompt, you get an answer, and the interesting parts are invisible: the exact text that went to the model after your code stitched it together, what that one call cost, how long it took, whether it called a tool, and whether a prompt or model change quietly made the answers worse.&lt;/p&gt;

&lt;p&gt;In the browser you'd open the Network tab. For AI calls there wasn't a good local equivalent, especially in .NET. So I built one: &lt;strong&gt;Seerlens&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynsc3k136kohnj5v88no.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynsc3k136kohnj5v88no.gif" alt="Seerlens demo" width="799" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is
&lt;/h2&gt;

&lt;p&gt;One command, and a local dashboard shows every LLM call your app makes, live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; Seerlens
seerlens   &lt;span class="c"&gt;# dashboard at http://localhost:5005&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point your app at it. In .NET you wrap the &lt;code&gt;IChatClient&lt;/code&gt; you already use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Seerlens.Sdk&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;SeerlensTrace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://localhost:5005"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;IChatClient&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;baseClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSeerlens&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every call through &lt;code&gt;client&lt;/code&gt; shows up: the prompt, the completion, tokens, cost in dollars, latency, and any tool calls. It's local-first, SQLite, no signup, no cloud.&lt;/p&gt;

&lt;p&gt;It's built on the OpenTelemetry GenAI conventions, so it isn't .NET-only (any OTLP app works, and there are small SDKs for Python and JS). But I lead with .NET on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why .NET
&lt;/h2&gt;

&lt;p&gt;The .NET AI stack grew up fast: Microsoft.Extensions.AI, Semantic Kernel, the Aspire dashboard. It traces calls well. What it doesn't do is judge whether the answer was any good, or turn tokens into a budget you can act on. The Python world has Langfuse, Phoenix, Promptfoo, Braintrust for that. .NET had basically nothing. That gap is the whole reason Seerlens exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I actually care about: evals
&lt;/h2&gt;

&lt;p&gt;Tracing gets you in the door. The thing that separates "called an API once" from "ran AI for real" is catching quality regressions. You write a small golden set, score answers against it, and watch the trend over time.&lt;/p&gt;

&lt;p&gt;You can gate CI on it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;seerlens &lt;span class="nb"&gt;eval &lt;/span&gt;support &lt;span class="nt"&gt;--min&lt;/span&gt; 0.8 &lt;span class="nt"&gt;--baseline&lt;/span&gt; .seerlens/support.base
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That exits non-zero if the score drops below a floor, or regresses too far from a saved baseline. So a model swap that quietly drops answer quality becomes a red check on the PR, not a surprise in production.&lt;/p&gt;

&lt;p&gt;There are three scorers: &lt;code&gt;keyword&lt;/code&gt; (offline), &lt;code&gt;llm-judge&lt;/code&gt; (grade against a rubric), and one I'm happy with, &lt;code&gt;agent&lt;/code&gt;: it gives the model a case's tools, lets it actually call them, and scores whether it reached for the right tools in the right order. "Right answer, wrong tool path" shows up as a lower score.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it's not
&lt;/h2&gt;

&lt;p&gt;Worth being upfront, because it shapes whether it fits you. It's single-user and local: no auth, no shared dashboard. SQLite is fine for the dev loop, not a production firehose. The agent scorer uses tools you declare with canned results, it doesn't execute your real tools. And cost is only as fresh as the price table (which you can override). For a team watching production traffic, a deployed platform is the right call. This is the local dev-loop tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;MIT licensed, on GitHub, NuGet, PyPI and npm.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/eladser/seerlens" rel="noopener noreferrer"&gt;https://github.com/eladser/seerlens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dotnet tool install -g Seerlens&lt;/code&gt; / &lt;code&gt;pip install seerlens&lt;/code&gt; / &lt;code&gt;npm install seerlens&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a side project I've been building in the open, so I'd genuinely like feedback on where it falls short.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>ai</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
