Skip to content
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

Add Portkey LLMOps integration #7877

Merged
merged 9 commits into from
Jul 20, 2023
Merged

Conversation

vrushankportkey
Copy link
Contributor

@vrushankportkey vrushankportkey commented Jul 18, 2023

Integrating Portkey, which adds production features like caching, tracing, tagging, retries, etc. to langchain apps.

  • Dependencies: None
  • Twitter handle: https://twitter.com/portkeyai
  • test_portkey.py added for tests
  • example notebook added in new utilities folder in modules

Also fixed a bug with OpenAIEmbeddings where headers weren't passing.

cc @baskaryan

@vercel
Copy link

vercel bot commented Jul 18, 2023

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

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 4:05pm

@dosubot dosubot bot added Ɑ: embeddings Related to text embedding models module 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Jul 18, 2023
@vercel vercel bot temporarily deployed to Preview July 18, 2023 10:03 Inactive
@@ -112,6 +113,7 @@ async def async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) ->

@_async_retry_decorator(embeddings)
async def _async_embed_with_retry(**kwargs: Any) -> Any:
kwargs.update(embeddings._invocation_params) # Add invocation params
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invocation params should already be passed in as the kwargs, were you seeing issues here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. For example, passing headers here: response = OpenAIEmbeddings(headers={"x-portkey-api-key": "API_KEY"}) isn't working.

This is unique only to OpenAIEmbeddings on Python. For other models + on JS, it is working.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm not able to recreate. if i mess with headers seems to propagate to top level commands (e.g. embed_query)

Screenshot 2023-07-18 at 5 18 47 PM

Copy link
Contributor Author

@vrushankportkey vrushankportkey Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, dropping that change for now - will verify from my end later

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Revert openai embeddings changes
@vercel vercel bot temporarily deployed to Preview July 19, 2023 01:41 Inactive
@vercel vercel bot temporarily deployed to Preview July 19, 2023 02:02 Inactive
@vrushankportkey
Copy link
Contributor Author

@baskaryan fixed formartting erros. It should pass all checks now.

@vercel vercel bot temporarily deployed to Preview July 20, 2023 04:19 Inactive
@baskaryan
Copy link
Collaborator

looks amazing, thanks @vrushankportkey!

@baskaryan baskaryan added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jul 20, 2023
@vercel vercel bot temporarily deployed to Preview July 20, 2023 15:52 Inactive
@vercel vercel bot temporarily deployed to Preview July 20, 2023 16:05 Inactive
@baskaryan baskaryan merged commit 5f10d2e into langchain-ai:master Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: embeddings Related to text embedding models module 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants