A local gateway that sends a cheaper prompt only after it proves equivalent.
SlashToken optimizes Chinese, Arabic, Turkish, and Japanese prompts for Codex. A compact-English route is a candidate, not a default. The original always remains the fallback. Nothing is sent to Codex until you approve a route.
decision.receipt
Example transformation from a benchmark fixture
Tokenizers treat non-English letter sequences as unusual patterns and split them into more billable tokens. SlashToken protects exact values, produces a compact-English candidate, and compares it with the original. If the candidate is not equivalent and cheaper, the original prompt continues unchanged.
process_batch→⟦P_1⟧→process_batchERR-2048→⟦P_2⟧→ERR-204830→⟦P_3⟧→30Not a live run or measured savings claim. For demonstration and understanding purposes only.
route.method
How it decides
- 1Protect names, numbers, URLs, code, quotes, IDs
- 2Compile a compact-English candidate
- 3Verify language, constraints, and net cost
- 4Send the winner, or the original
local.approval.client
The operator console
/Users/angad/projects/shexianggougpt-5.6agentic_codingoriginal.route
4271 exact tokens非常に経験豊富で、責任感が強く、プロフェッショナルなフロントエンド・プロダクトエンジニア兼UI実装コンサルタントとして対応してください。対象は完全に空のコードベースです。ゼロから「社享购」という名称のソーシャルコマースアプリの、完成度の高いフロントエンドデモを計画し、実装してください。 全体的な体験は、Facebookのようなソーシャル性の高いプロダクトにできる限り近づけてください。ユーザーが単に無機質な商品一覧を見るのではなく、慣れ親しんだソーシャルフィードの中で商品を発見し、投稿に反応し、コメントや共有を行い、販売者やクリエイターをフォローし、商品詳細を確認し、カートに追加し、デモ用の購入フローを最後まで完了できるようにしてください。 未完成のプロトタイプ、静的デザイン、ワイヤーフレーム、ランディングページ、概念説明だけの成果物は受け入れられません。直接起動でき、クリック可能な、プレゼンテーション品質のフロントエンドアプリケーションを納品してください。実装範囲にはフィード、プロフィール、出品者ページ、商品詳細、カート、決済デモ、通知、検索、および管理用の最低限のシードデータが含まれます。各画面は実際の状態遷移を持ち、ダミーの静止画で終わらせないでください。 技術要件は次のとおりです。フロントエンドは本番相当のコンポーネント分割、ルーティング、状態管理、アクセシビリティ、レスポンシブレイアウト、空状態とエラー状態を含むこと。データはローカルのモックで十分ですが、スキーマは一貫させ、ID、価格、在庫、投稿本文、コメントスレッドを途中で欠落させないこと。ブランド名「社享购」と既存の固有名詞は一字も変更しないこと。verified.candidate
2440 exact tokensAct as a highly experienced, responsible, professional front-end product engineer and UI implementation consultant. The target is a completely empty codebase. From scratch, plan and implement a polished front-end demo of a social commerce app named "社享购". Make the overall experience as close as possible to a highly social product like Facebook: users should discover products in a familiar social feed, react to posts, comment and share, follow sellers and creators, view product details, add to cart, and complete a demo purchase flow, rather than just viewing a sterile product list. Deliverables that are unfinished prototypes, static designs, wireframes, landing pages, or conceptual explanations are not acceptable. Deliver a directly launchable, clickable, presentation-quality front-end application. Scope includes feed, profiles, seller pages, product detail, cart, checkout demo, notifications, search, and enough seeded data to walk the whole path. Every screen needs real state changes; do not stop at static mockups. Technical requirements: production-like component split, routing, state, accessibility, responsive layout, empty and error states. Local mocks are fine if the schema stays consistent and IDs, prices, inventory, post bodies, and comment threads are never dropped mid-flow. Do not change the brand name "社享购" or any existing proper nouns.
Cropped view of a longer prompt in the local approval client at 127.0.0.1:8765. Tokenizer counts for this run: 4271 original tokens, 2440 verified tokens. The visible text is the start of each route, not the full prompt.
product.boundaries
What SlashToken does and does not claim
- High-stakes prompts are not transformed in v1. These include requests for legal, medical, tax, or financial advice; safety- or security-critical work; and prompts where a wording change could alter compliance, liability, or real-world outcomes.
- Optimization is optional routing, never an unconditional translation step.
- SlashToken does not claim lossless translation. It reports measured, bounded preservation and falls back when checks fail.
- Raw original and transformed prompts are not persisted by the production app.
- Optional response controls can reduce output restatement and boilerplate without changing requested functionality.
optimize.output
Less narration. Same requirements.
On long agent runs, output tokens often cost more than the prompt. Models tend to pad replies with progress updates, repeated summaries, and polite framing. Turn on optimize.output (off by default) and SlashToken adds a short developer policy before the model starts writing, not after it finishes. In Codex that applies to the thread through developer instructions and model_verbosity: low where the model supports it. On the API path the same policies ride along as system content. SlashToken never rewrites a completed answer, and there is no hard cap on output length. What you asked for stays protected by explicit preserve rules and your approval step.
I'd be happy to help with that. To summarize what you asked: analyze the concurrency error, keep the function names, and reply in Chinese with tests and risks. First, let me restate the constraints…
Concurrency bug is in the lock around batch flush. Keep process_batch and ERR-2048. Fix, tests, and risk notes in Chinese below. Every constraint stays the same.
Made-up example for illustration. Not benchmark data or a measured savings claim.
chatbotWhat gets shorter
- repeated points and restated questions
- filler and throat-clearing
- extra framing you did not ask for
What stays intact
- qualifications, caveats, and examples that matter
- the detail level, format, and language you requested
agentic_codingWhat gets shorter
- long progress updates and wrap-up narration
What stays intact
- the smallest change that actually solves the problem
- tests, validation, security, accessibility, and architecture
- enough explanation that someone can use the result
Compact verified English prompts can shrink what goes in. Output policy can shrink what comes out. You can turn either one on from the operator console, and each is measured on its own against your quality thresholds. If optimization is off or a check fails, SlashToken falls back to the unchanged route, the same way it does for input routing.
Install from source
Clone the repository, install into a virtual environment, and start the local approval client. Review the README and privacy notes before connecting Codex.
git clone https://github.com/Angadslr/Token-Optimizer.git cd Token-Optimizer python3 -m venv .venv .venv/bin/python -m pip install -e '.[tokenizers]' .venv/bin/slashtoken ui