DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to measure how many prompt tokens selection saves with Schemagate

Compare the DDL a model gets with and without Schemagate for one question on the bundled schema.

Who it is forA team lead estimating the token cost of a text-to-SQL agent before rolling it out on a large schema.

The problemPasting the whole schema into every prompt costs more as the schema grows, and the cost is hard to estimate without seeing the actual prompt.

The outcomeYou see the reduced DDL for one question, with a token count compared against the full schema.

What you need first

  • Python and pip installed
  • For your own database: a reachable Postgres, Oracle, MySQL or SQL Server URL, and the matching schemagate extra
  • Optional: a model key only if you want generated answers or AI descriptions

Steps

  1. Run pip install schemagate to install the library.
  2. Run schemagate demo "late shipments by carrier" --prompt to print the DDL the model would receive.
  3. Run schemagate demo "which customers owe us money" and note the objects count and approximate token figure shown.
  4. Repeat with your own questions and compare against the full schema size.

Prompt for your agent

Install schemagate, then run `schemagate demo "late shipments by carrier" --prompt` and `schemagate demo "which customers owe us money"`. Report the number of selected objects and the approximate prompt token count for each, and state the total object count of the bundled schema.

Caveat. The savings figures in the README come from the test schemas and a built-in estimator, so your own schema and tokenizer will give different numbers.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for ashishsinha1602/schemagate and "Measure how many prompt tokens selection saves"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer