<?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>Forem: Praful Reddy</title>
    <description>The latest articles on Forem by Praful Reddy (@prafulreddy).</description>
    <link>https://forem.com/prafulreddy</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3871637%2Fdfb49680-d4a7-46ca-b39b-0859d4c61fbd.jpg</url>
      <title>Forem: Praful Reddy</title>
      <link>https://forem.com/prafulreddy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/prafulreddy"/>
    <language>en</language>
    <item>
      <title>I built an open-source Python tool to detect drift in embedding spaces</title>
      <dc:creator>Praful Reddy</dc:creator>
      <pubDate>Fri, 17 Apr 2026 00:19:56 +0000</pubDate>
      <link>https://forem.com/prafulreddy/i-built-an-open-source-python-tool-to-detect-drift-in-embedding-spaces-2ea4</link>
      <guid>https://forem.com/prafulreddy/i-built-an-open-source-python-tool-to-detect-drift-in-embedding-spaces-2ea4</guid>
      <description>&lt;h1&gt;
  
  
  I built an open-source Python tool to detect drift in embedding spaces
&lt;/h1&gt;

&lt;p&gt;Most monitoring pipelines wait for a downstream metric to break: accuracy drops, retrieval quality slips, or user-facing behavior gets worse.&lt;/p&gt;

&lt;p&gt;By then, the shift has already happened.&lt;/p&gt;

&lt;p&gt;I wanted a simpler way to catch changes earlier by looking directly at the embeddings themselves.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;drift-lens-monitor&lt;/strong&gt; — an open-source Python package for detecting drift in embedding spaces.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/PRAFULREDDYM/Drift_lense" rel="noopener noreferrer"&gt;https://github.com/PRAFULREDDYM/Drift_lense&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/drift-lens-monitor/" rel="noopener noreferrer"&gt;https://pypi.org/project/drift-lens-monitor/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What problem this solves
&lt;/h2&gt;

&lt;p&gt;A lot of modern ML systems depend on embeddings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;semantic search&lt;/li&gt;
&lt;li&gt;RAG pipelines&lt;/li&gt;
&lt;li&gt;recommenders&lt;/li&gt;
&lt;li&gt;clustering&lt;/li&gt;
&lt;li&gt;classification pipelines with embedding-based features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even when the raw system looks “healthy,” the embedding space can start changing underneath you.&lt;/p&gt;

&lt;p&gt;That change may come from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new user behavior&lt;/li&gt;
&lt;li&gt;model updates&lt;/li&gt;
&lt;li&gt;data source changes&lt;/li&gt;
&lt;li&gt;upstream preprocessing differences&lt;/li&gt;
&lt;li&gt;gradual distribution shift over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you only monitor business metrics or model accuracy, you often detect the issue late.&lt;/p&gt;

&lt;p&gt;The idea behind this project is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;take snapshots of embeddings over time and compare them directly.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What drift-lens-monitor includes
&lt;/h2&gt;

&lt;p&gt;The package currently supports three drift detection approaches.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Fréchet Embedding Distance (FED)
&lt;/h3&gt;

&lt;p&gt;This is inspired by FID-style comparison, but applied to arbitrary embeddings.&lt;/p&gt;

&lt;p&gt;At a high level, it compares the mean and covariance of two embedding distributions.&lt;/p&gt;

&lt;p&gt;Useful when you want a compact statistical distance between a reference snapshot and a current snapshot.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Maximum Mean Discrepancy (MMD)
&lt;/h3&gt;

&lt;p&gt;This is a kernel-based, non-parametric method for comparing two samples.&lt;/p&gt;

&lt;p&gt;I included permutation-based p-values so it can be used not just as a raw distance, but also as a statistical test.&lt;/p&gt;

&lt;p&gt;Useful when you want a more flexible distribution comparison without assuming Gaussian structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Persistent homology
&lt;/h3&gt;

&lt;p&gt;This is the unusual one.&lt;/p&gt;

&lt;p&gt;Instead of only asking whether two embedding clouds differ statistically, this looks at whether their &lt;strong&gt;shape&lt;/strong&gt; changes.&lt;/p&gt;

&lt;p&gt;It builds topological summaries over the point cloud and compares them using Wasserstein distance.&lt;/p&gt;

&lt;p&gt;Why that matters:&lt;/p&gt;

&lt;p&gt;A system can preserve rough averages while still changing structurally. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;clusters merge&lt;/li&gt;
&lt;li&gt;clusters split&lt;/li&gt;
&lt;li&gt;holes or loops appear/disappear&lt;/li&gt;
&lt;li&gt;local geometry shifts in ways mean/covariance may not capture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes persistent homology an interesting complement to more standard drift metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design goals
&lt;/h2&gt;

&lt;p&gt;I wanted the tool to stay practical:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;local-first&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;no cloud dependency&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;no API keys&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;simple snapshot storage&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;easy to inspect and extend&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snapshots are stored as &lt;strong&gt;parquet files&lt;/strong&gt;, so the workflow stays lightweight and reproducible.&lt;/p&gt;

&lt;p&gt;The package can be used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;as a Python library&lt;/li&gt;
&lt;li&gt;through a &lt;strong&gt;Streamlit dashboard&lt;/strong&gt; for visual exploration&lt;/li&gt;
&lt;/ul&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;
bash
pip install drift-lens-monitor

## Example workflow

The intended workflow is straightforward:

1. Save a reference embedding snapshot
2. Save a new embedding snapshot later
3. Compare them using one or more drift methods
4. Inspect drift scores and visualize the changes

This makes it usable for both experimentation and production-adjacent monitoring workflows.

## Why I built it

I was interested in a gap I keep seeing in ML tooling:

we monitor model outputs, latency, costs, and downstream metrics heavily, but we often do much less direct monitoring of the representation space itself.

Embeddings are doing a huge amount of work in modern AI systems. They deserve first-class monitoring too.

I also wanted to explore whether more unusual techniques like **topological drift detection** could add signal beyond standard statistical distances.

## What I’d love feedback on

I’d especially love feedback on three things:

1. Does persistent homology feel genuinely useful here, or too heavyweight?
2. What baselines or benchmark datasets would make this more convincing?
3. How should the package/API be improved to make it easier to use in real workflows?

## Links

- GitHub: https://github.com/PRAFULREDDYM/Drift_lense
- PyPI: https://pypi.org/project/drift-lens-monitor/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
    <item>
      <title>A zero-token progress bar for Claude Code</title>
      <dc:creator>Praful Reddy</dc:creator>
      <pubDate>Fri, 10 Apr 2026 11:48:59 +0000</pubDate>
      <link>https://forem.com/prafulreddy/a-zero-token-progress-bar-for-claude-code-51bp</link>
      <guid>https://forem.com/prafulreddy/a-zero-token-progress-bar-for-claude-code-51bp</guid>
      <description>&lt;p&gt;Every Claude Code extension I've seen shows the same thing: token counts, API costs, model info. Useful, but it doesn't answer the question I actually care about mid-session — how much of the work is done.&lt;br&gt;
So I built task-progress-bar. It reads Claude Code's native task list from disk and renders a live ASCII progress bar with time estimates. It runs as a PostToolUse hook, which means it consumes zero tokens — it's a subprocess that Claude never sees.&lt;/p&gt;

&lt;p&gt;Tasks [████████░░] 8/10 (~3m left) | ✓8 ⟳1 ○1&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Claude Code persists tasks as JSON files in ~/.claude/tasks/. The plugin watches for TodoWrite, TodoRead, TaskCreate, and TaskUpdate tool calls via the PostToolUse hook, then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parses every JSON file in the tasks directory&lt;/li&gt;
&lt;li&gt;Counts completed, in-progress, and pending tasks&lt;/li&gt;
&lt;li&gt;Computes a time estimate using an exponential moving average (EMA)&lt;/li&gt;
&lt;li&gt;Outputs a single status line to Claude Code's statusLine renderer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The time estimation is straightforward. Each time a task moves to completed, the timestamp is logged. The interval between consecutive completions feeds into an EMA with α=0.3:&lt;/p&gt;

&lt;p&gt;EMA_new = 0.3 × latest_interval + 0.7 × EMA_old&lt;br&gt;
estimated_remaining = EMA × tasks_left&lt;/p&gt;

&lt;p&gt;Intervals over 1 hour are clamped to avoid skew from session breaks. The first 3 completions show "calculating..." until there's enough data.&lt;br&gt;
The entire plugin is a single Python file — stdlib only, no pip dependencies. It uses json, pathlib, time, and sys. Nothing else.&lt;/p&gt;

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

&lt;p&gt;curl -fsSL &lt;a href="https://raw.githubusercontent.com/PRAFULREDDYM/task-progress-bar/main/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/PRAFULREDDYM/task-progress-bar/main/install.sh&lt;/a&gt; | bash&lt;/p&gt;

&lt;p&gt;The installer checks for Python 3.8+, copies the script to ~/.claude/, and patches settings.json with the hook configuration. There's a matching uninstall.sh for clean removal.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&gt;

&lt;p&gt;The progress bar color-codes by completion percentage — red below 33%, yellow from 33–66%, green above 66%. When all tasks finish, it shows ✅ All done! for 30 seconds and then hides.&lt;br&gt;
If you run it standalone (python3 task_progress_bar.py), you get a full multi-line colored view with a task breakdown and per-task average.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://dev.tourl"&gt;github.com/PRAFULREDDYM/task-progress-bar&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Requirements: Python 3.8+, Claude Code v2.1+&lt;/li&gt;
&lt;li&gt;License: MIT&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claudecode</category>
      <category>productivity</category>
      <category>terminal</category>
      <category>python</category>
    </item>
  </channel>
</rss>
