Skip to content

feat: add LiteLLM as LLM provider (Python SDK + TypeScript proxy)#183

Merged
nicolotognoni merged 1 commit into
PatterAI:mainfrom
RheagalFire:feat/add-litellm-provider
Jun 17, 2026
Merged

feat: add LiteLLM as LLM provider (Python SDK + TypeScript proxy)#183
nicolotognoni merged 1 commit into
PatterAI:mainfrom
RheagalFire:feat/add-litellm-provider

Conversation

@RheagalFire

Copy link
Copy Markdown
Contributor

Summary

Add LiteLLM as an LLM provider, giving users access to 100+ LLM providers (OpenAI, Anthropic, Google, Azure, AWS Bedrock, Ollama, Cohere, Mistral, and more) through a single unified interface. Python SDK uses the native litellm SDK (litellm.acompletion); TypeScript SDK uses LiteLLM as an OpenAI-compatible proxy.

Changes

  • libraries/python/getpatter/providers/litellm_llm.py - LiteLLMProvider satisfying the LLMProvider protocol (streaming, tool calls, cancel_event barge-in, usage tracking, warmup). drop_params=True by default for cross-provider compatibility.
  • libraries/python/getpatter/llm/litellm.py - thin LLM wrapper with LITELLM_API_KEY env var fallback.
  • libraries/typescript/src/llm/litellm.ts - LLM preset extending OpenAICompatibleLLMProvider with LiteLLM proxy defaults (LITELLM_BASE_URL, LITELLM_API_KEY).
  • libraries/python/pyproject.toml - litellm = ["litellm>=1.80.0,<2.0"] optional extra.
  • libraries/python/tests/test_litellm_llm.py - 7 unit tests (mocked).
  • libraries/typescript/tests/litellm-llm.test.ts - 4 unit tests.
  • Registration in both SDK barrels (__init__.py, index.ts) with LiteLLMLLM flat alias and litellm namespace object.

Pre-merge checklist

  • Local validation is green: bash scripts/pr-validate.sh (mirrors the
    PR-blocking CI — Python + TypeScript tests, lint, pre-commit).
  • Both SDKs updated when the change is user-visible — every public
    feature ships in Python AND TypeScript in the same PR, same API shape
    and defaults (snake_casecamelCase). New/Python-only or TS-only is
    not accepted.
  • CHANGELOG.md updated — added an entry under ## Unreleased
    (### Added / ### Changed / ### Fixed / …) for any user-visible
    change. Refactor / test-only / docs-only diffs are exempt — say so below.
  • Tests added for new behaviour; only the paid/external boundary
    (carrier / provider WebSocket) is mocked.
  • No secrets, credentials, or real phone numbers / PII in the diff.
  • No external license headers or "ported from " provenance
    comments
    in source files (integrating a provider/carrier and naming it
    is fine; copying a competitor's lineage is not).

Breaking change?

No — or describe the migration path.

Signed-off-by: RheagalFire <arishalam121@gmail.com>
@nicolotognoni nicolotognoni self-assigned this Jun 17, 2026
@nicolotognoni nicolotognoni merged commit 7c0c079 into PatterAI:main Jun 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants