Polyglot Guide
Inference
Inference
Overview
Inference
class offers access to LLM APIs and convenient methods to execute
model inference, incl. chat completions, tool calling or JSON output
generation.
LLM providers access details can be found and modified via /config/llm.php
.
Examples
Simple text inference
Simplified inference API uses the default connection for convenient ad-hoc calls. Default LLM connection can be configured via config/llm.php.
Regular synchronous inference
Regular inference API allows you to customize inference options, specific for given LLM provider. Most providers options are compatible with OpenAI API.
Streaming inference results
Inference API allows streaming responses, which is useful for building more responsive UX as you can display partial responses from LLM as soon as they arrive, without waiting until the whole response is ready.