and improving the performance of your AI applications.LLMOps for Langchain‚ÄãPortkey brings production readiness to Langchain. With Portkey, you can  view detailed metrics & logs for all requests,  enable semantic cache to reduce latency & costs,  implement automatic retries & fallbacks for failed requests,  add custom tags to requests for better tracking and analysis and more.Using Portkey with Langchain‚ÄãUsing Portkey is as simple as just choosing which Portkey features you want, enabling them via headers=Portkey.Config and passing it in your LLM calls.To start, get your Portkey API key by signing up here. (Click the profile icon on the top left, then click on "Copy API Key")For OpenAI, a simple integration with logging feature would look like this:from langchain.llms import OpenAIfrom langchain.utilities import Portkey# Add the Portkey API Key from your accountheaders = Portkey.Config(    api_key = "<PORTKEY_API_KEY>")llm = OpenAI(temperature=0.9, headers=headers)llm.predict("What would be a good company name for a company that makes colorful socks?")Your logs will be captured on your Portkey dashboard.A common Portkey X Langchain use case is to trace a chain or an agent and view all the LLM calls originating from that request. Tracing Chains & Agents‚Äãfrom langchain.agents import AgentType, initialize_agent, load_tools  from langchain.llms import OpenAIfrom langchain.utilities import Portkey# Add the Portkey API Key from your accountheaders = Portkey.Config(    api_key = "<PORTKEY_API_KEY>",    trace_id = "fef659")llm = OpenAI(temperature=0, headers=headers)  tools = load_tools(["serpapi", "llm-math"], llm=llm)  agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)    # Let's test it out!  agent.run("What was the high temperature in SF yesterday in Fahrenheit? What is that number raised to the .023 power?")You can see the requests' logs along with the trace id on Portkey dashboard:Advanced Features‚ÄãLogging: Log all
Portkey is a platform designed to streamline the deployment
Portkey is a platform designed to streamline the deployment ->: and improving the performance of your AI applications.LLMOps for Langchain‚ÄãPortkey brings production readiness to Langchain. With Portkey, you can  view detailed metrics & logs for all requests,  enable semantic cache to reduce latency & costs,  implement automatic retries & fallbacks for failed requests,  add custom tags to requests for better tracking and analysis and more.Using Portkey with Langchain‚ÄãUsing Portkey is as simple as just choosing which Portkey features you want, enabling them via headers=Portkey.Config and passing it in your LLM calls.To start, get your Portkey API key by signing up here. (Click the profile icon on the top left, then click on "Copy API Key")For OpenAI, a simple integration with logging feature would look like this:from langchain.llms import OpenAIfrom langchain.utilities import Portkey# Add the Portkey API Key from your accountheaders = Portkey.Config(    api_key = "<PORTKEY_API_KEY>")llm = OpenAI(temperature=0.9, headers=headers)llm.predict("What would be a good company name for a company that makes colorful socks?")Your logs will be captured on your Portkey dashboard.A common Portkey X Langchain use case is to trace a chain or an agent and view all the LLM calls originating from that request. Tracing Chains & Agents‚Äãfrom langchain.agents import AgentType, initialize_agent, load_tools  from langchain.llms import OpenAIfrom langchain.utilities import Portkey# Add the Portkey API Key from your accountheaders = Portkey.Config(    api_key = "<PORTKEY_API_KEY>",    trace_id = "fef659")llm = OpenAI(temperature=0, headers=headers)  tools = load_tools(["serpapi", "llm-math"], llm=llm)  agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)    # Let's test it out!  agent.run("What was the high temperature in SF yesterday in Fahrenheit? What is that number raised to the .023 power?")You can see the requests' logs along with the trace id on Portkey dashboard:Advanced Features‚ÄãLogging: Log all