QStash LLM API
You can publish (or enqueue) single LLM request or batch LLM requests using all existing QStash features natively. To do this, specify the destinationapi
as llm
with a valid provider. The body of the published or enqueued message should contain a valid chat completion request. For these integrations, you must specify the Upstash-Callback
header so that you can process the response asynchronously. Note that streaming chat completions cannot be used with them. Use the chat API for streaming completions.
All the examples below can be used with OpenAI-compatible LLM providers.