Skip to content

Add LiteLLM activity sample - #343

Draft
Abhinav0905 wants to merge 1 commit into
temporalio:mainfrom
Abhinav0905:litellm-workflow-sample
Draft

Add LiteLLM activity sample#343
Abhinav0905 wants to merge 1 commit into
temporalio:mainfrom
Abhinav0905:litellm-workflow-sample

Conversation

@Abhinav0905

Copy link
Copy Markdown

What changed

  • Added a standalone litellm_activity sample with serializable Workflow inputs.
  • Kept LiteLLM network I/O in a Temporal Activity so Workflow replay remains deterministic.
  • Added Activity timeouts, Temporal-controlled retries, provider configuration, and setup documentation.
  • Added deterministic Activity and Workflow tests with no live provider calls.
  • Added the LiteLLM dependency group, package metadata, root sample listing, and lockfile entries.

Why

LLM provider calls are nondeterministic network operations and must run outside Workflow code. This sample demonstrates the Activity boundary directly while making timeouts and retry behavior visible in Temporal Event History.

Closes #239.

User impact

Users can run the sample against any LiteLLM-supported provider by setting provider credentials on the Worker and selecting a model with LITELLM_MODEL. Credentials are not passed through the Workflow or stored in Event History.

Validation

  • Ruff import ordering and lint checks
  • Ruff formatting check
  • MyPy on the new sample and tests
  • pytest tests/litellm_activity (2 passed)

cc @brianstrauch

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


abhinav seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[Feature Request] Add sample demonstrating how to make liteLLM calls from a workflow

2 participants