@radzor/llm-completion
Universal LLM completion client supporting OpenAI, Anthropic, and Ollama. Provides chat completions, streaming, conversation history, and automatic retries with exponential backoff.
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| provider* | 'openai' | 'anthropic' | 'ollama' | — | LLM provider to use. |
| apiKey | string | — | API key for the provider. Required for openai and anthropic, optional for ollama.OPENAI_API_KEY |
| model* | string | — | Model identifier (e.g. gpt-4o, claude-sonnet-4-20250514, llama3). |
| baseUrl | string | — | Override the API base URL. Useful for proxies or self-hosted instances. |
| maxTokens | number | 4096 | Maximum tokens to generate in the response. |
| temperature | number | 0.7 |