qiqizjl opened a new pull request, #12841: URL: https://github.com/apache/apisix/pull/12841
## Summary Fix incorrect metrics reporting when LLM plugin is not enabled. ## Problem When the LLM plugin is not enabled, the nginx variables for LLM metrics were defaulting to '0', which caused the metrics to be incorrectly reported as active even when no LLM functionality was being used. ## Solution Changed the default values from '0' to '' (empty string) for the following nginx variables: - `llm_time_to_first_token` - `llm_prompt_tokens` - `llm_completion_tokens` Also updated the condition check in `openai-base.lua` to properly detect when LLM functionality is not active. ## Changes - `apisix/cli/ngx_tpl.lua`: Changed default values from '0' to '' - `apisix/plugins/ai-drivers/openai-base.lua`: Updated condition check 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
