Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat(review): pluggable per-model tokenizer for exact token counts

オープン
#239 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java

調査の方向性

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 の本文から書いたものです。

説明

enhancement java

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 TokenCounter interface 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_tokens regardless, 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

devops-thiago/ThrillhouseBot のほかの issue

devops-thiago/ThrillhouseBot の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。