Skip to content

Commit a5f239d

Browse files
author
Motta Kin
committed
Remove custom_llm_provider as it's not needed
1 parent 5190e3f commit a5f239d

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

docs/models/openai.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ print(result.output)
568568

569569
To use [LiteLLM](https://www.litellm.ai/), set the configs as outlined in the [doc](https://docs.litellm.ai/docs/set_keys). In `LiteLLMProvider`, you can pass `api_base` and `api_key`. The value of these configs will depend on your setup. For example, if you are using OpenAI models, then you need to pass `https://api.openai.com/v1` as the `api_base` and your OpenAI API key as the `api_key`. If you are using a LiteLLM proxy server running on your local machine, then you need to pass `http://localhost:<port>` as the `api_base` and your LiteLLM API key (or a placeholder) as the `api_key`.
570570

571+
To use custom LLMs, use `custom/` prefix in the model name.
572+
571573
Once you have the configs, use the [`LiteLLMProvider`][pydantic_ai.providers.litellm.LiteLLMProvider] as follows:
572574

573575
```python

pydantic_ai_slim/pydantic_ai/providers/litellm.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def __init__(
8787
*,
8888
api_key: str | None = None,
8989
api_base: str | None = None,
90-
custom_llm_provider: str | None = None,
9190
) -> None: ...
9291

9392
@overload
@@ -96,7 +95,6 @@ def __init__(
9695
*,
9796
api_key: str | None = None,
9897
api_base: str | None = None,
99-
custom_llm_provider: str | None = None,
10098
http_client: AsyncHTTPClient,
10199
) -> None: ...
102100

@@ -108,7 +106,6 @@ def __init__(
108106
*,
109107
api_key: str | None = None,
110108
api_base: str | None = None,
111-
custom_llm_provider: str | None = None,
112109
openai_client: AsyncOpenAI | None = None,
113110
http_client: AsyncHTTPClient | None = None,
114111
) -> None:
@@ -117,7 +114,6 @@ def __init__(
117114
Args:
118115
api_key: API key for the model provider. If None, LiteLLM will try to get it from environment variables.
119116
api_base: Base URL for the model provider. Use this for custom endpoints or self-hosted models.
120-
custom_llm_provider: Custom LLM provider name for LiteLLM. Use this if LiteLLM can't auto-detect the provider.
121117
openai_client: Pre-configured OpenAI client. If provided, other parameters are ignored.
122118
http_client: Custom HTTP client to use.
123119
"""

tests/providers/test_litellm.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ def test_init_with_api_config():
2222
assert provider.client.api_key == 'test-key'
2323

2424

25-
def test_init_with_custom_llm_provider():
26-
provider = LiteLLMProvider(api_key='test-key', custom_llm_provider='anthropic')
27-
assert provider.name == 'litellm'
28-
29-
3025
def test_init_without_api_key():
3126
provider = LiteLLMProvider()
3227
assert provider.name == 'litellm'

0 commit comments

Comments
 (0)