Map Thinking Budget to Reasoning Effort for OpenAI Models
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 65/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- typescript
- Domaine
- backend-api-design
Piste de recherche
Start by locating the OpenAI adapter and the sibling issue's isReasoning branch, then read how it builds bodyPayload and accesses the model sampling profile. Add the specified thinkingBudget mapping and cover numeric thresholds, string values, absent budgets, and standard models in tests. Done when those tests and the listed typecheck, test, and lint commands pass.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Goal
Add reasoning_effort parameter support to the OpenAI adapter for reasoning models that accept it (o3, o3-mini, o4-mini, gpt-6).
Background
OpenAI's reasoning models accept a reasoning_effort parameter with values "low", "medium", or "high" that controls how many internal thinking tokens the model uses. Currently Codra sends no such parameter and cannot tune the cost/quality tradeoff for reasoning model calls.
This sub-issue is part of the parent issue: OpenAI adapter incompatible with reasoning models.
What to Build
After the isReasoning branch is in place (see sibling sub-issue), read the thinkingBudget from the model's sampling profile and map it to reasoning_effort:
if (isReasoning && sampling?.thinkingBudget) {
let effort: "low" | "medium" | "high" | undefined;
if (typeof sampling.thinkingBudget === "number") {
effort =
sampling.thinkingBudget > 10000 ? "high"
: sampling.thinkingBudget > 3000 ? "medium"
: "low";
} else if (
sampling.thinkingBudget === "low" ||
sampling.thinkingBudget === "medium" ||
sampling.thinkingBudget === "high"
) {
effort = sampling.thinkingBudget;
}
if (effort) {
bodyPayload.reasoning_effort = effort;
}
}
Done When
-
reasoning_effortis included in requests to supported reasoning models when a thinking budget is configured - Numeric budgets are mapped to low/medium/high correctly
- String values low/medium/high are passed through directly
- The parameter is omitted when no thinking budget is configured
- Standard (non-reasoning) models are not affected
- Tests cover all mapping cases and the absent-budget case
-
npm run typecheck,npm test, andnpm run lintall pass
- Langage dominant
- TypeScript
- Étoiles
- 125
- Forks
- 23
- Merge moyen
- 2 j 13 h
- PR mergées (30 j)
- 12
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de devarshishimpi/codra
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
devarshishimpi/codra#178 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
devarshishimpi/codra#176 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
devarshishimpi/codra#186 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
devarshishimpi/codra#185 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 4/5 3-5 jours Accessibilité débutants 58/100
devarshishimpi/codra#184 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de devarshishimpi/codra
Issues similaires
-
agent-ready area: ui-server priority: p3 type: test
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
schlessera/brain-kit#4249 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation tool triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
can1357/oh-my-pi#19608 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
dependencies tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
bcgov/nr-waste-plus#1549 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
blixvip/solana-tx-parse#18 ·