Skip to content

Updated cohere v2 passthrough #9997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 15, 2025
Merged

Conversation

krrishdholakia
Copy link
Contributor

@krrishdholakia krrishdholakia commented Apr 15, 2025

Title

Ensures pass-through calls for cohere have cost tracking

from langchain_cohere import ChatCohere # pip install langchain-cohere~=0.4.1

base_url = "http://0.0.0.0:4000/" # 👈 PROXY BASE URL
token = "sk-1234"

llm = ChatCohere(
    model="command-r",
    cohere_api_key=token,
    base_url=f"{base_url}/cohere",
)

llm.invoke("hola")

Relevant issues

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

If UI changes, send a screenshot/GIF of working UI fixes

* feat(cohere_passthrough_handler.py): initial working commit with cohere passthrough cost tracking

* fix(v2_transformation.py): support cohere /v2/chat endpoint

* fix: fix linting errors
Copy link

vercel bot commented Apr 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 1:10am

@krrishdholakia krrishdholakia merged commit 2ed593e into main Apr 15, 2025
38 of 42 checks passed
@krrishdholakia krrishdholakia deleted the litellm_dev_04_14_2025_p2 branch April 15, 2025 02:51
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.

1 participant