{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "ashishsinha1602-schemagate--measure-prompt-savings-on-a-schema",
 "repo": "ashishsinha1602/schemagate",
 "repo_url": "https://github.com/ashishsinha1602/schemagate",
 "repo_slug": "ashishsinha1602-schemagate",
 "title": "Measure how many prompt tokens selection saves",
 "page_title": "How to measure how many prompt tokens selection saves with Schemagate",
 "summary": "Compare the DDL a model gets with and without Schemagate for one question on the bundled schema.",
 "who": "A team lead estimating the token cost of a text-to-SQL agent before rolling it out on a large schema.",
 "problem": "Pasting the whole schema into every prompt costs more as the schema grows, and the cost is hard to estimate without seeing the actual prompt.",
 "outcome": "You see the reduced DDL for one question, with a token count compared against the full schema.",
 "steps": [
  "Run `pip install schemagate` to install the library.",
  "Run `schemagate demo \"late shipments by carrier\" --prompt` to print the DDL the model would receive.",
  "Run `schemagate demo \"which customers owe us money\"` and note the objects count and approximate token figure shown.",
  "Repeat with your own questions and compare against the full schema size."
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "15 minutes",
 "basis": "readme",
 "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.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ashishsinha1602-schemagate/measure-prompt-savings-on-a-schema/",
 "md": "https://dedupedai.com/use-cases/ashishsinha1602-schemagate/measure-prompt-savings-on-a-schema/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ashishsinha1602-schemagate--measure-prompt-savings-on-a-schema.json",
 "api_version": "v1"
}
