Skip to content

feat: add LiteLLM support via litellm: model prefix#347

Open
RheagalFire wants to merge 2 commits into
TimeCopilot:mainfrom
RheagalFire:feat/add-litellm-provider
Open

feat: add LiteLLM support via litellm: model prefix#347
RheagalFire wants to merge 2 commits into
TimeCopilot:mainfrom
RheagalFire:feat/add-litellm-provider

Conversation

@RheagalFire

@RheagalFire RheagalFire commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Adds LiteLLM support via a litellm: model prefix, letting users route forecasting through 100+ LLM providers (Anthropic, Groq, Bedrock, Vertex AI, DeepSeek, etc.) using the litellm SDK directly - no proxy needed.

Changes

  • timecopilot/agent.py - added _resolve_llm() that detects litellm: prefix and creates a pydantic-ai model via litellm.AsyncOpenAI() with drop_params=True
  • pyproject.toml - added [litellm] optional dependency (litellm>=1.80.0,<1.87.0)

Example usage

pip install 'timecopilot[litellm]'

# Set your provider's API key
export ANTHROPIC_API_KEY="sk-ant-..."

# Use any litellm model string
timecopilot forecast data.csv --llm litellm:anthropic/claude-sonnet-4-6
timecopilot chat --llm litellm:groq/llama-3.3-70b-versatile
from timecopilot import AsyncTimeCopilot

copilot = AsyncTimeCopilot(llm="litellm:anthropic/claude-sonnet-4-6")
result = await copilot.forecast(df)

Any LiteLLM-supported model string works: anthropic/claude-sonnet-4-6, groq/llama-3.3-70b-versatile, bedrock/anthropic.claude-v2, deepseek/deepseek-chat, etc.

@CLAassistant

CLAassistant commented Jun 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@RheagalFire

Copy link
Copy Markdown
Author

cc @AzulGarza @mcallara

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