Commit 121dcdc
Configurable max_tokens/max_completion_tokens key (#399)
## Summary
<!--
Include a short paragraph of the changes introduced in this PR.
If this PR requires additional context or rationale, explain why
the changes are necessary.
-->
Makes the `max_tokens` request key configurable through an environment
variable per endpoint type. Defaults to `max_tokens` for legacy
`completions` and `max_completion_tokens` for `chat/completions`
## Details
<!--
Provide a detailed list of all changes introduced in this pull request.
-->
- Add the `GUIDELLM__OPENAI__MAX_OUTPUT_KEY` config option which is a
dict mapping from route name -> output tokens key. Default is
`{"text_completions": "max_tokens", "chat_completions":
"max_completion_tokens"}`
## Test Plan
<!--
List the steps needed to test this PR.
-->
-
## Related Issues
<!--
Link any relevant issues that this PR addresses.
-->
- Closes #395
- Closes #269
- Related #210
---
- [x] "I certify that all code in this PR is my own, except as noted
below."
## Use of AI
- [ ] Includes AI-assisted code completion
- [ ] Includes code generated by an AI application
- [ ] Includes AI-generated tests (NOTE: AI written tests should have a
docstring that includes `## WRITTEN BY AI ##`)
---------
Signed-off-by: Tyler Michael Smith <[email protected]>
Signed-off-by: Samuel Monson <[email protected]>
Co-authored-by: Tyler Michael Smith <[email protected]>1 parent a24a22d commit 121dcdc
File tree
3 files changed
+14
-9
lines changed- src/guidellm
- backend
- tests/unit
3 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
450 | | - | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | | - | |
471 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | | - | |
| 143 | + | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | 164 | | |
167 | 165 | | |
168 | 166 | | |
| |||
0 commit comments