Ana Sayfa / Kod ve Scriptler / Tokensaver Kit

Tokensaver Kit

Görevleri daha ucuz bulut veya yerel çalışan LLM'lere devrederek maliyet ve belirteçten tasarruf etmeye yardımcı olan bir kit ve daha fazlası.

  • Yayın tarihi13 Kasım 2026
  • Nerede çalışırPython 3.10, Python 3.11, Python 3.12, Python 3.13, Python 3.14
  • Paket içeriği.py
  • Son güncelleme13 Kasım 2026
  • Canlı demoVar
Tokensaver Kit

Overview

Your frontier model should design and review—not spend the session typing.

Claude Code and GitHub Copilot are valuable for planning, reasoning and reviewing code. But a lot of a coding session can still be spent on implementation: reading files, writing functions and tests, running checks, and fixing errors. TokenSaver Kit lets your main assistant delegate that implementation work to a coding agent running on your own local model (LM Studio, Ollama, llama.cpp, Jan or vLLM). When a task is too difficult for the local model, it can be handed to a slim cloud worker. Your frontier model stays focused on the decisions. The coding agent does the repetitive implementation work.

How it works

  • 🖥️ Local coding agent — no model API fees. Your assistant gives the local model a short brief. The agent can read and search your project, edit and create files, write tests, run checks, inspect failures and try to fix them. tsk checks the project after every command, undoes changes to protected or unlisted files, and reverts a run when its check still fails.
  • 📏 Briefs matched to your model. Smaller models need smaller, more explicit tasks. A 9B laptop model might receive one or two functions with the steps spelled out. A stronger model you have benchmarked can receive a concise goal covering a whole module and its tests. Set the level with tsk init --level, and your assistant gets the corresponding instructions.
  • ☁️ A slim cloud worker for harder tasks. When the local model is not up to the job, delegate to a lower-cost cloud model (for example, Haiku). The worker receives a restricted set of tools and uses low reasoning effort to keep the work focused.
  • 🧠 Your frontier model remains in control. It handles architecture, planning, diagnosis and final review rather than doing every implementation step itself.
  • 🔁 Automatic fallback. Run tsk local --cloud-fallback to try the local model first. When the local run fails, the same brief and checks are passed to the cloud worker. Your assistant can initiate the workflow with one command: local first, cloud second.
  • 📊 Track usage and known spend. tsk stats reports project runs, pass rates, local tokens, recorded cloud credits or USD, missing usage records and execution time. You can also assign your frontier model's prices to local token usage to estimate its hypothetical value. That estimate is not measured savings.

How much could you save?

We do not promise a fixed percentage. Actual savings depend on your tasks, model, hardware, briefs, codebase, cloud provider and how much work needs to be retried or reviewed. TokenSaver Kit gives you data to evaluate your own workflow:

  • tsk stats shows project runs, pass rates, local tokens and known cloud spend.
  • tsk cloud prints a cost line after every call, including failed and timed-out calls. When the CLI does not report usage, the cost is marked as unknown.
  • Local inference has no model API fee, but it still uses your hardware, electricity and time.
  • Your main assistant still spends tokens preparing briefs and reviewing diffs. Failed local attempts and cloud fallbacks also count towards the overall cost.

The routing rules are designed to keep briefs short and tasks appropriately sized, so that delegating work is worthwhile rather than creating more overhead.

What we measured

We tested the bundled tasks using NeoHorse-1-9B Q4_K_M on one machine. The local model cost was $0 in API fees. These are results from a small, seller-authored task set—not an independent industry benchmark.

  • Tasks 01–05: The model passed 5/5 with step-by-step briefs in 162 seconds, and 5/5 with one-sentence goal briefs in 1,019 seconds.
  • Tasks 06–10: These covered implementing from tests, fixing a bug, writing tests, making a multi-file change and creating a new module. The model passed 4/5 with either brief style.
  • Known weakness: It struggled to write tests strong enough to catch deliberately planted bugs.
  • Before agent mode: With edit blocks only and no tools, the same model passed just 1/5 goal-only tasks. Reading test files and rerunning tests helped close that gap.
  • ###strong/strong### Short, detailed briefs can take longer. Two tasks took 7–8 minutes instead of 30 seconds.

Larger models may be faster and pass more tasks. Results will vary by model and hardware. Use tsk bench --brief short to test your own setup rather than relying on our results.

Features

1. tsk — a zero-dependency command-line tool

Requires Python 3.8+ and supports macOS, Linux and Windows.

  • <strong>tsk local</strong>— local coding agent. Sends a JSON brief to your local model and gives it six tools: read, search, list, exact replace, create/write and run. It can edit only the files or patterns you allow. Changes made to protected or unlisted files are undone. It runs your configured check and a short, restricted command allow list, retries with error output, and automatically reverts a run if the check still fails. Changes that are undone are copied to .tsk/undone/ first. Git-ignored build output such as target/ and dist/ does not trigger the file guard. Use --cloud-fallback to send a failed local run to the cloud worker. A search/replace-only mode is also available for servers without tool-calling support.
  • <strong>tsk cloud</strong>— restricted cloud worker. Runs a brief through Copilot CLI or Claude Code with a minimal tool set. It prints a cost line after every call, including failures and timeouts; when the CLI supplies no usage data, it reports cost unknown. After the worker finishes, tsk checks its changes, undoes edits outside the allowed files, runs your configured check and keeps only a passing run.
  • <strong>tsk bench</strong>— test your models. Smoke-tests local or cloud models on 25 bundled tasks across four tiers. The default run covers the 10 tier-1 tasks: implementation, implementation from tests, bug fixing, writing tests that catch planted bugs, a three-file feature and a new module. It supports step-by-step briefs and short goal-only briefs, and reports pass rate, time, tokens and cost. This is a quick screening tool, not proof of reliability—review the diffs.
  • <strong>tsk doctor</strong>— check your setup. Checks your configuration in one command. tsk doctor --deep sends your model a real tool call to verify that agent mode works before you rely on it.
  • <strong>tsk init</strong>— set up a project. Installs the required project configuration in one command.
  • <strong>tsk stats</strong>— inspect your usage. Reports runs, pass rates, tokens, known cloud credits or USD, unknown-cost runs and hypothetical frontier-token value for each project.

2. Ready-made routing rules and worker agents

Includes configurations for:

  • Claude Code: CLAUDE.md instructions and a Haiku subagent.
  • GitHub Copilot: copilot-instructions.md and a custom agent.
  • Other coding tools: an AGENTS.md version.

3. File protection and other guardrails

TokenSaver Kit includes safeguards against accidental changes, but it is not a security sandbox and cannot guarantee that your project or files are safe. The guardrails include:

  • Local agents are restricted to the files or patterns you allow.
  • Changes made by commands to protected or unlisted files are undone.
  • Failed runs are reverted after the configured checks fail.
  • Undone changes are copied to .tsk/undone/ before being reverted.
  • Cloud workers receive a restricted tool set, shell allow and deny lists, a git push block, and have cloud-credential environment variables removed.
  • A cloned repository's configuration cannot redirect your key or loosen these settings.

The included guide explains what these protections do, what they do not prevent, and how to use them responsibly.

4. Complete setup and usage guide

The guide covers:

  • Setup for supported model servers and IDEs.
  • Choosing local models for systems with 8, 16 or 32 GB of RAM.
  • Writing briefs that smaller models can successfully complete.
  • Benchmarking models and measuring usage and costs.
  • Troubleshooting common problems, including thinking loops, thoughts appearing in code comments and memory pressure.

5. Notes from our model testing

Includes observations about which local models failed, how task size and brief style affected the 9B models we tested, and when using a local model may not be worthwhile.

Who is TokenSaver Kit for?

  • Developers using Claude Code, GitHub Copilot or API-based coding assistants who want to reduce the amount of expensive model usage spent on routine implementation.
  • Developers with a Mac or PC capable of running a 7B–9B local model. Around 16 GB of RAM is a comfortable starting point, depending on the model, quantization and workload.
  • Teams that want a shared, reviewable setup instead of relying on everyone's individual prompts and ad-hoc workflows.

Don't have a local model? Cloud-only mode is supported.

You can use the slim cloud worker without configuring a local model. You need Python and either Claude Code or GitHub Copilot CLI installed and signed in. For Copilot: tsk init --copilot --mode cloud-only For Claude Code: tsk init --claude --engine claude --mode cloud-only Re-running setup preserves the selected mode.

Running larger local models

We also measured one 27B Q4 model on two NVIDIA T4 GPUs using full briefs, including harder task tiers. Short, goal-only briefs on larger models have not been measured yet. The guide explains how to assess your own hardware and model. Do not treat r

Requirements

Requirements and important notes

  • Python 3.8 or newer.
  • No model weights are included. You supply and configure your own local model.
  • Local inference uses your own hardware; it does not incur model API fees.
  • Cloud execution requires your own supported Claude Code and/or GitHub Copilot access. It may incur third-party usage charges depending on your provider, plan and configuration.
  • TokenSaver Kit does not include cloud model credits or third-party subscriptions.
  • Review agent-generated diffs and test results before accepting changes.