feat(review): pluggable per-model tokenizer for exact token counts
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- ai, backend-api-design
調査の方向性
Start by reading the implementation of the TokenCounter interface and the per-model configuration introduced by issues #53 and #50. Then inspect langchain4j's built-in estimators for OpenAI, Anthropic, and Gemini and how the budgeter uses them. Done means matching models use their provider estimator, unmatched models fall back to jtokkit, and self-calibration from API token usage continues.
索引モデルが issue の本文から書いたものです。
説明
Problem
The large-diff token budgeting (#53) ships with a single jtokkit (OpenAI BPE) encoding as the estimate for all providers, self-calibrated from the usage.prompt_tokens the API echoes back. That's exact for OpenAI models but approximate for others (e.g. DeepSeek/Gemini/Anthropic use different vocabularies). For closer budgeting on non-OpenAI models, make the estimator pluggable.
Proposed (enhancement — jtokkit stays the default)
- Keep the
TokenCounterinterface introduced by #53; the default stays jtokkit (OpenAI BPE) for any model without a better estimator. - Reuse langchain4j's built-in per-provider token estimators rather than rolling our own — langchain4j already ships estimators for OpenAI, Anthropic, and Gemini. Wire the matching one behind
TokenCounter, keyed by the configured model/provider, for better estimates on those specific models. - Fall back to jtokkit when no provider estimator matches; the budgeter keeps self-calibrating from
usage.prompt_tokensregardless, so estimates only improve.
No conflict with #53
This plugs in behind the same TokenCounter interface #53 introduces — #53 ships jtokkit-default; #239 swaps in the langchain4j per-provider estimator per model. Nothing in #53 changes.
Depends on
#53 — introduces TokenCounter + the jtokkit default + the per-model config surface (#50). Post-v0.3.0 enhancement.
- 主要言語
- Java
- スター
- 35
- フォーク
- 7
- 平均マージ
- 9時間 23分
- マージ済み PR(30日)
- 154
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devops-thiago/ThrillhouseBot のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
devops-thiago/ThrillhouseBot#1093 ·
メンテナーはふだん 1 日以内に返信
-
documentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
devops-thiago/ThrillhouseBot#321 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
devops-thiago/ThrillhouseBot#46 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
devops-thiago/ThrillhouseBot#1095 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
devops-thiago/ThrillhouseBot#1094 ·
メンテナーはふだん 1 日以内に返信
devops-thiago/ThrillhouseBot の issue をすべて見る
似ている issue
-
agent-java community triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elastic/apm-agent-java#4594 ·
メンテナーはふだん 1 日以内に返信
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kestra-io/plugin-aws#816 ·
メンテナーはふだん 2 日以内に返信
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
kestra-io/plugin-kestra#200 ·
メンテナーはふだん 1 日以内に返信
-
bug untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
opensearch-project/search-relevance#618 ·
メンテナーはふだん 3 日以内に返信