Skip to content

Commit 1e6fb11

Browse files
authored
add verbose stats to mlc-chat REST API (mlc-ai#1049)
* add verbose stats to mlc-chat REST API * update docs
1 parent 20131fb commit 1e6fb11

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/deploy/rest.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ The REST API provides the following endpoints:
8989
9090
Get the latest runtime stats (encode/decode speed).
9191

92+
.. http:get:: /verbose_stats
93+
94+
Get the verbose runtime stats (encode/decode speed, total runtime).
9295

9396
Use REST API in your own program
9497
--------------------------------

python/mlc_chat/rest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ async def read_stats():
327327
"""
328328
return session["chat_mod"].stats()
329329

330+
@app.get("/verbose_stats")
331+
async def read_stats_verbose():
332+
"""
333+
Get the verbose runtime stats.
334+
"""
335+
return session["chat_mod"].stats(verbose=True)
330336

331337
ARGS = convert_args_to_argparser().parse_args()
332338
if __name__ == "__main__":

0 commit comments

Comments
 (0)