explaingit

deftruth/chain-of-draft

Analysis updated 2026-07-13 · repo last pushed 2025-03-11

Audience · developerComplexity · 2/5StaleSetup · easy

TLDR

Chain of Draft is a prompting technique that makes AI language models solve problems with far less text by writing only essential notes instead of long explanations, cutting costs and response time while keeping accuracy.

Mindmap

mindmap
  root((repo))
    What it does
      Reduces AI text output
      Keeps reasoning accuracy
      Cuts cost and time
    Tech stack
      OpenAI models
      Claude models
      OpenAI-compatible API
    Use cases
      Math tutoring apps
      Sports trivia tools
      Date understanding
    Audience
      App builders
      Cost-conscious startups
      AI developers
    How it works
      Minimalistic prompts
      Configuration files
      Evaluation scripts
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a math tutoring app that gives faster, cheaper answers by reducing AI reasoning text.

USE CASE 2

Create a sports statistics Q&A tool that cuts API costs by generating only essential reasoning notes.

USE CASE 3

Run the included evaluations to compare standard AI reasoning against the lean Chain of Draft approach.

USE CASE 4

Integrate the technique into any app using OpenAI or Claude models to speed up response times.

What is it built with?

PythonOpenAI APIClaude API

How does it compare?

deftruth/chain-of-draft0xhassaan/nn-from-scratch0xzgbot/hermes-comfyui-skills
Stars00
LanguagePython
Last pushed2025-03-11
MaintenanceStale
Setup difficultyeasymoderateeasy
Complexity2/54/51/5
Audiencedeveloperdeveloperdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires an API key for OpenAI or Claude to run the evaluations.

The license is not specified in the repository explanation, so permission terms are unknown.

In plain English

Chain of Draft helps AI language models solve problems faster and cheaper by teaching them to think more like humans do. When today's AI tackles a reasoning task, it typically writes out long, verbose step-by-step explanations. This project instead prompts the AI to jot down only the essential information needed at each step, much like a person scribbling quick notes in the margin. The result is that the AI reaches the right answer just as accurately, but uses as little as 7.6% of the text it would normally generate. The core idea is about reducing waste in the AI's intermediate reasoning. Standard step-by-step prompting has the model write out full sentences and explanations for every part of its thought process. Chain of Draft swaps in a different set of instructions and examples that encourage the model to be minimalistic. By generating only short, critical insights instead of full paragraphs, the overall process speeds up and costs less, since AI usage is typically billed by the volume of text generated. This project would be useful for anyone building applications that rely on AI reasoning, especially when cost and response time matter. For example, a startup building a math tutoring app or a tool that answers complex sports statistics questions could use this approach to get answers to their users faster and at a fraction of the API cost. The repository includes ready-to-run evaluations across a few task types, including math word problems, date understanding, sports trivia, and coin-flip reasoning. The repository supports popular models from OpenAI and Claude, as well as any model that uses an OpenAI-compatible interface. Users can run the provided evaluation script to test the approach themselves, with all the prompts and examples stored in simple configuration files. The tradeoff the project makes is straightforward: it bets that brevity won't hurt accuracy, and the results suggest that cutting the fat from AI reasoning actually preserves performance while saving significant time and money.

Copy-paste prompts

Prompt 1
How do I use the Chain of Draft prompting technique with OpenAI models in my Python app to reduce reasoning token costs?
Prompt 2
Show me how to run the evaluation scripts in the deftruth/chain-of-draft repo to compare standard chain-of-thought against chain of draft on math problems.
Prompt 3
Write a Chain of Draft prompt for a sports trivia assistant that asks the model to keep each reasoning step under 15 words while maintaining accuracy.
Prompt 4
How can I configure the deftruth/chain-of-draft repo to work with an OpenAI-compatible API endpoint like a local model server?
Prompt 5
Create a configuration file entry for a coin-flip reasoning task using the Chain of Draft format from the deftruth/chain-of-draft repository.

Frequently asked questions

What is chain-of-draft?

Chain of Draft is a prompting technique that makes AI language models solve problems with far less text by writing only essential notes instead of long explanations, cutting costs and response time while keeping accuracy.

Is chain-of-draft actively maintained?

Stale — no commits in 1-2 years (last push 2025-03-11).

What license does chain-of-draft use?

The license is not specified in the repository explanation, so permission terms are unknown.

How hard is chain-of-draft to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is chain-of-draft for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.