W1 Gateway Chat Model icon

W1 Gateway Chat Model

Use W1 AI Gateway (LiteLLM) as a language model in AI agents and chains. The gateway endpoint is pre-configured – only an API key is required.

W1 Gateway Chat Model

AI-generated

Summary

Configure and instantiate a chat language model that uses the W1 LiteLLM AI Gateway to generate conversational AI responses based on the specified model and parameters.

Inputs

  • Model (required) — Specify the name of the language model to use (e.g., gpt-4o-mini, gpt-4o, claude-3-5-sonnet). The model must be available in the W1 LiteLLM gateway.
  • Options — Adjust advanced generation parameters including sampling temperature (controls creativity), maximum tokens (limit output length), top P (nucleus sampling threshold), frequency penalty (reduces repeated phrases), presence penalty (encourages new topics), max retries (number of retry attempts on failure), and timeout (request timeout in milliseconds).

Output shape

a single AI language model instance compatible with LangChain, ready to be used in AI agents and chains for generating chat completions

The output is an object containing a 'response' property that holds the configured LangChain ChatOpenAI model instance which internally uses the W1 LiteLLM gateway API endpoint.

Links

Discussion