AI UNDERDOGS
Back
0:00 / 1:00
#029

Sketch

github.com/approximatelabs/sketch
AI coding assistantData sciencePythonOpen source
165 views💬 0 comments🔗 0 visits

Give AI your data, then let it write the code

WHAT IT SOLVES

Most AI code tools know syntax but not your actual data — so the code they write doesn't work

WHY IT'S INTERESTING

Product taste

Understands data without copying it

Point Sketch at a pandas DataFrame and it auto-derives schema, distributions, and samples — then feeds that context to the LLM. No manual description needed

Real craft

2.3k stars, but still runs fully local

A recent PR added pure local mode — no external API calls. For a data tool, pulling LLM inference local shows the author takes data privacy seriously

TECH GUESS

Python with tight pandas integration, pluggable LLM backend including local-only mode

DEEP DIVE

The Real Problem: AI Doesn't Know Your Data

Most AI coding assistants like Copilot only understand syntax — they have no idea what's actually in your DataFrame. So the pandas code they generate often doesn't work: wrong column names, mismatched types, operations that don't match your data's actual shape. Sketch's core insight is simple but powerful: let AI understand your data first, then let it write the code.

How It Works: In-Place Understanding Without Copying Data

When you attach Sketch to a pandas DataFrame, it automatically analyzes the schema (column names, types), distribution statistics, and sample data, then feeds all of that as context to the LLM. You don't have to manually describe your data — it reads it itself. In the HN thread, creator bluecoconut explained the difference from Copilot: "Sketch offers a more 'local' data context (pinning to the actual data)," meaning it uses the current state of your data as the basis for code generation, not just comments or variable names.

Technically, Sketch is built on the author's own framework, lambdaprompt, and defaults to GPT-3 (text-davinci-003). You can switch to Codex, but the author admits it only offers a marginal quality boost. More interestingly, bluecoconut says they're training their own foundation model using "a hybrid tokenization of data and word tokens" — signaling this isn't meant to stay a thin API wrapper. They want to go deeper on data understanding.

Privacy Done Right: 2.3k+ Stars, and It Runs Locally

Sketch has 2.3k+ GitHub stars, but for a data tool, the more meaningful detail is the recent addition of pure local mode — no external API dependency. This matters because, as HN user vorpalhex put it bluntly: "the risk of your sql walking off to an AI vendor is not worth the time savings." For teams handling sensitive business data, a tool that can run LLM inference locally is fundamentally more valuable than another OpenAI wrapper.

Who Should (and Shouldn't) Use This

If you spend your days writing pandas in Jupyter Notebooks, Sketch fits naturally into your workflow. HN user hgarg said they spent weeks building a text-to-SQL tool and gave up because "your approach is much better. Pandas is used a lot. Build a tool on top of pandas." No tool-switching, no context loss.

If you're a pure SQL user, it's a harder sell. HN user allisdust asked about direct database connections — not supported out of the box, though you could bridge through pyodbc as harvey9 suggested. And as jadbox noted, if you just want an AI SQL IDE, Sketch's pandas-native integration becomes unnecessary baggage.

Honest Limitations

Sketch is fundamentally a context-augmented prompt engineering project. It solves the problem of "give the LLM enough data context," not the inherent limitations of LLMs themselves. When schemas are complex or column names are semantically ambiguous, AI will still guess wrong. The pure local mode protects privacy, but local model quality and speed are still unproven — the author acknowledges their own model training is ongoing. With 145 commits but only 7 issues and 1 PR, community contribution is very early-stage; if you hit a bug, expect to debug it yourself.

📍 Source: hn📅 2026-05-30Original post →Visit site →
Ad
Ad slot (AdSense unit renders here once connected)

Discussion (0)

Sign in with GitHub to post
  • No comments yet — be the first.

Related