Skip to content

Commit c14ab90

Browse files
committed
init
Signed-off-by: Yan Chunwei <[email protected]>
1 parent 9d719dd commit c14ab90

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

docs/source/_static/custom.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.tag {
2-
padding: 2px 5px;
3-
border-radius: 4px;
2+
padding: 2px 3px;
3+
border-radius: 3px;
44
font-size: 0.8em;
55
margin-right: 5px;
66
color: #000;
@@ -9,7 +9,7 @@
99
code.beta {
1010
display: inline-block;
1111
background-color: #6c757d;
12-
color: #999;
12+
color: #fff;
1313
}
1414

1515
code.prototype {
@@ -23,3 +23,9 @@ code.deprecated {
2323
background-color: red;
2424
color: #fff;
2525
}
26+
27+
code.stable {
28+
display: inline-block;
29+
background-color: #28a745;
30+
color: #fff;
31+
}

docs/source/helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ def generate_llmapi():
312312
content = underline("API Reference", "-") + "\n\n"
313313
content += ".. note::\n"
314314
content += " Since version 1.0, we have attached a status label to `LLM`, `LlmArgs` and `TorchLlmArgs` Classes.\n\n"
315-
content += ' 1. :tag:`prototype` - The item is a prototype and is subject to change.\n'
316-
content += ' 2. :tag:`beta` - The item is in beta and approaching stability.\n'
317-
content += ' 3. :tag:`deprecated` - The item is deprecated and will be removed in a future release.\n'
318-
content += " 4. For the remaining items without a status label, they are considered **stable**.\n"
315+
content += " 1. :tag:`stable` - The item is stable and will keep consistent.\n"
316+
content += ' 2. :tag:`prototype` - The item is a prototype and is subject to change.\n'
317+
content += ' 3. :tag:`beta` - The item is in beta and approaching stability.\n'
318+
content += ' 4. :tag:`deprecated` - The item is deprecated and will be removed in a future release.\n'
319319
content += "\n"
320320

321321
for cls_name in public_classes_names:

tensorrt_llm/llmapi/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ def get_type_repr(cls):
550550
return f"{module_name}.{cls.__qualname__}"
551551

552552

553+
LABEL_STABLE_APIS: bool = True
554+
""" Whether to label the stable APIs with `stable` tags. """
555+
556+
553557
class ApiParamTagger:
554558
''' A helper to tag the api doc according to the status of the fields.
555559
The status is set in the json_schema_extra of the field.
@@ -567,6 +571,9 @@ def _process_pydantic_model(self, cls: Type[BaseModel]) -> None:
567571
status = field_info.json_schema_extra['status']
568572
self._amend_pydantic_field_description_with_tags(
569573
cls, [field_name], status)
574+
elif LABEL_STABLE_APIS:
575+
self._amend_pydantic_field_description_with_tags(
576+
cls, [field_name], "stable")
570577

571578
def _amend_pydantic_field_description_with_tags(self, cls: Type[BaseModel],
572579
field_names: list[str],

0 commit comments

Comments
 (0)