Liking cljdoc? Tell your friends :D

litellm.providers.core

Core provider protocol and utilities for LiteLLM

Core provider protocol and utilities for LiteLLM
raw docstring

authentication-errorclj

(authentication-error provider)

Create an authentication error (DEPRECATED - use litellm.errors/authentication-error)

Create an authentication error (DEPRECATED - use litellm.errors/authentication-error)
sourceraw docstring

calculate-costclj

(calculate-cost provider-name model prompt-tokens completion-tokens)

Calculate cost for a request/response

Calculate cost for a request/response
sourceraw docstring

compare-providersclj

(compare-providers provider-names)

Compare multiple providers on various capabilities

Compare multiple providers on various capabilities
sourceraw docstring

create-standard-choiceclj

(create-standard-choice index message finish-reason)

Create a standard choice format

Create a standard choice format
sourceraw docstring

create-standard-messageclj

(create-standard-message role content & {:keys [tool-calls function-call]})

Create a standard message format

Create a standard message format
sourceraw docstring

create-standard-responseclj

(create-standard-response id model choices usage & {:keys [object created]})

Create a standard response format

Create a standard response format
sourceraw docstring

create-standard-usageclj

(create-standard-usage prompt-tokens completion-tokens)

Create a standard usage format

Create a standard usage format
sourceraw docstring

default-provider-configclj

(default-provider-config provider-name)

Get default configuration for a provider

Get default configuration for a provider
sourceraw docstring

estimate-request-tokensclj

(estimate-request-tokens request)

Estimate token count for a request

Estimate token count for a request
sourceraw docstring

estimate-tokensclj

(estimate-tokens text)

Rough estimation of token count for text

Rough estimation of token count for text
sourceraw docstring

extract-model-nameclj

(extract-model-name model)

Extract actual model name from model string (e.g., 'openai/gpt-4' -> 'gpt-4')

Extract actual model name from model string (e.g., 'openai/gpt-4' -> 'gpt-4')
sourceraw docstring

extract-provider-nameclj

(extract-provider-name model)

Extract provider name from model string (e.g., 'openai/gpt-4' -> :openai)

Extract provider name from model string (e.g., 'openai/gpt-4' -> :openai)
sourceraw docstring

find-providers-for-modelclj

(find-providers-for-model provider-names model)

Find all providers that support a given model

Find all providers that support a given model
sourceraw docstring

get-cost-per-tokencljmultimethod

Get cost per token for a specific model

Get cost per token for a specific model
sourceraw docstring

get-rate-limitscljmultimethod

Get provider rate limits as a map

Get provider rate limits as a map
sourceraw docstring

health-checkcljmultimethod

Perform health check, returns a future with boolean result

Perform health check, returns a future with boolean result
sourceraw docstring

list-available-providersclj

(list-available-providers)

List all available providers by checking multimethod implementations

List all available providers by checking multimethod implementations
sourceraw docstring

log-provider-statusclj

(log-provider-status provider-name)

Log provider status for debugging

Log provider status for debugging
sourceraw docstring

make-requestcljmultimethod

Make HTTP request to provider API, returns a future

Make HTTP request to provider API, returns a future
sourceraw docstring

make-streaming-requestcljmultimethod

Make streaming HTTP request to provider API, returns a core.async channel

Make streaming HTTP request to provider API, returns a core.async channel
sourceraw docstring

merge-provider-configclj

(merge-provider-config provider-name user-config)

Merge user config with provider defaults

Merge user config with provider defaults
sourceraw docstring

model-not-found-errorclj

(model-not-found-error provider model)

Create a model not found error (DEPRECATED - use litellm.errors/model-not-found)

Create a model not found error (DEPRECATED - use litellm.errors/model-not-found)
sourceraw docstring

parse-model-stringclj

(parse-model-string model)

Parse model string into provider (keyword) and model components

Parse model string into provider (keyword) and model components
sourceraw docstring

provider-available?clj

(provider-available? provider-name)

Check if a provider is available (has multimethod implementations)

Check if a provider is available (has multimethod implementations)
sourceraw docstring

provider-errorclj

(provider-error provider message & {:keys [status code data]})

Create a provider-specific error (DEPRECATED - use litellm.errors/provider-error)

Create a provider-specific error (DEPRECATED - use litellm.errors/provider-error)
sourceraw docstring

provider-statusclj

(provider-status provider-name)

Get comprehensive provider status

Get comprehensive provider status
sourceraw docstring

provider-supports-model?clj

(provider-supports-model? provider-name model)

Check if provider supports a specific model

Check if provider supports a specific model
sourceraw docstring

quota-exceeded-errorclj

(quota-exceeded-error provider)

Create a quota exceeded error (DEPRECATED - use litellm.errors/quota-exceeded)

Create a quota exceeded error (DEPRECATED - use litellm.errors/quota-exceeded)
sourceraw docstring

rate-limit-errorclj

(rate-limit-error provider & {:keys [retry-after]})

Create a rate limit error (DEPRECATED - use litellm.errors/rate-limit)

Create a rate limit error (DEPRECATED - use litellm.errors/rate-limit)
sourceraw docstring

supports-function-calling?cljmultimethod

Check if provider supports function calling

Check if provider supports function calling
sourceraw docstring

supports-streaming?cljmultimethod

Check if provider supports streaming responses

Check if provider supports streaming responses
sourceraw docstring

test-providerclj

(test-provider provider-name thread-pool telemetry config)

Test provider with a simple request

Test provider with a simple request
sourceraw docstring

transform-messages-from-openaiclj

(transform-messages-from-openai messages)

Transform messages from OpenAI format

Transform messages from OpenAI format
sourceraw docstring

transform-messages-to-openaiclj

(transform-messages-to-openai messages)

Transform messages to OpenAI format

Transform messages to OpenAI format
sourceraw docstring

transform-requestcljmultimethod

Transform a standard request to provider-specific format

Transform a standard request to provider-specific format
sourceraw docstring

transform-responsecljmultimethod

Transform provider response to standard format

Transform provider response to standard format
sourceraw docstring

transform-streaming-chunkcljmultimethod

Transform provider streaming chunk to standard format

Transform provider streaming chunk to standard format
sourceraw docstring

transform-tools-to-openaiclj

(transform-tools-to-openai tools)

Transform tools to OpenAI format

Transform tools to OpenAI format
sourceraw docstring

validate-provider-configclj

(validate-provider-config config)

Validate provider configuration

Validate provider configuration
sourceraw docstring

validate-requestclj

(validate-request provider-name request)

Validate request against provider capabilities

Validate request against provider capabilities
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close