-
Notifications
You must be signed in to change notification settings - Fork 290
feat(cli): add --verbose flag to chat command for detailed usage (#238) #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Thanks for the contribution! 🦾 Can you please show screenshots of what the output looks like when this is used? |
Think it might need a little polishing to make it better for a release candidate and I need to get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Left a couple comments.
src/subcommands/chat.ts
Outdated
}); | ||
} | ||
|
||
function displayVerboseStats(stats: any, logger: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please type those two parameters.
stats should be of type LLMPredictionStats
(from @lmstudio/lms-shared-types
)
logger should be of type SimpleLogger
(from @lmstudio/lms-common
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actioned.
src/subcommands/chat.ts
Outdated
if (stats.tokensPerSecond !== undefined) { | ||
logger.info(` Tokens/Second: ${stats.tokensPerSecond.toFixed(2)}`); | ||
} | ||
if (stats.numGpuLayers !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stat is currently not populated. Probably hide for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actioned.
src/subcommands/chat.ts
Outdated
short: "s", | ||
description: "Custom system prompt to use for the chat", | ||
}), | ||
verbose: flag({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--verbose
is one of the global flags in lms that enables debugging logging regarding connection, etc. Maybe --stats
?
…ve emoji and GPU layers stat - Add proper types for displayVerboseStats function parameters - Rename --verbose flag to --stats to avoid conflict with global verbose flag - Add short flag -t for --stats - Remove emoji from stats output for cleaner appearance - Hide numGpuLayers stat as it's not currently populated
Co-authored-by: Yagil Burowski <[email protected]>
src/subcommands/chat.ts
Outdated
}), | ||
stats: flag({ | ||
long: "stats", | ||
short: "t", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe no short flag for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actioned :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still here fyi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted, sorry!
src/subcommands/chat.ts
Outdated
} | ||
|
||
function displayVerboseStats(stats: LLMPredictionStats, logger: SimpleLogger) { | ||
logger.info("\nPrediction Stats:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have 2 * \n
here to create an empty buffer line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actioned :)
Merged. Expecting to ship this in 0.3.17+7. Thanks for the contribution! |
Summary
Adds a
--verbose
flag to thelms chat
CLI command to improve output visibility and help users debug model behavior in terminal use cases.This directly addresses issue #238, where users requested better visibility into token-level stats when using
lms chat
.Features
When
--verbose
is passed, the CLI logs:Example
lms chat -p "Hello world" --verbose