feat(review): pluggable per-model tokenizer for exact token counts
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- java
- Área
- ai, backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 35
- Forks
- 7
- Merge medio
- 9 h 23 min
- PR fusionados (30 d)
- 154
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de devops-thiago/ThrillhouseBot
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
devops-thiago/ThrillhouseBot#1093 ·
Los mantenedores suelen responder en 1 día
-
documentation enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
devops-thiago/ThrillhouseBot#321 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
devops-thiago/ThrillhouseBot#46 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
devops-thiago/ThrillhouseBot#1095 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
devops-thiago/ThrillhouseBot#1094 ·
Los mantenedores suelen responder en 1 día
Todos los issues de devops-thiago/ThrillhouseBot
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
iOS podspec depends on `React-Codegen`, which resolves to an unrelated pod on CocoaPods trunkAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
GantMan/jail-monkey#380 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
objectionary/jucs#145 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
objectionary/lints#1559 ·
Los mantenedores suelen responder en 2 días
-
RRateLimiter acquire methods accept negative permits and raise available permits above the rate.Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 4 días