Skip to content
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

feat: more precise control over the timeout for requests to the LLM service #12072

Open
LiteSun opened this issue Mar 20, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@LiteSun
Copy link
Member

LiteSun commented Mar 20, 2025

Description

Currently, AI-related plugins only have a timeout parameter. After reviewing the code, I found that timeout is the total of connect, read, and send timeout durations, making it impossible to precisely control the timeout for requests to the LLM service. This needs to be improved.

Currently https://github.com/apache/apisix/blob/master/apisix/plugins/ai-drivers/openai-base.lua#L70

...
local http = require("resty.http")
...

httpc:set_timeout(conf.timeout)

Expected:

...
local http = require("resty.http")
...

httpc:set_timeouts(connect_timeout, send_timeout, read_timeout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant