Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksArgillaConfidentContextInfinoLabel StudioLLMonitorPromptLayerSageMaker TrackingStreamlitTrubricsChat loadersComponentsCallbacksInfinoOn this pageInfinoThis example shows how one can track the following while calling OpenAI and ChatOpenAI models via LangChain and Infino:prompt input,response from ChatGPT or any other LangChain model,latency,errors,number of tokens consumedInitializing‚Äã# Install necessary dependencies.pip install -q infinopypip install -q matplotlibpip install -q tiktokenimport datetime as dtimport jsonfrom langchain.llms import OpenAIimport matplotlib.pyplot as pltimport matplotlib.dates as mdimport osimport timeimport sysfrom infinopy import InfinoClientfrom langchain.callbacks import InfinoCallbackHandlerStart Infino server, initialize the Infino client‚Äã# Start server using the Infino docker image.docker run --rm --detach --name infino-example -p 3000:3000 infinohq/infino:latest# Create Infino client.client = InfinoClient()    a1159e99c6bdb3101139157acee6aba7ae9319375e77ab6fbc79beff75abeca3Read the questions dataset‚Äã# These are a subset of questions from Stanford's QA dataset -# https://rajpurkar.github.io/SQuAD-explorer/data = """In what country is Normandy located?When were the Normans in Normandy?From which countries did the Norse originate?Who was the Norse leader?What century did the Normans first gain their separate identity?Who gave their name to Normandy in the 1000's and 1100'sWhat is France a region of?Who did King Charles III swear fealty to?When did the Frankish identity emerge?Who was the duke in the battle of Hastings?Who ruled the duchy of NormandyWhat religion were the NormansWhat type of major impact did the Norman
This example shows how one can track the following while calling OpenAI and ChatOpenAI models via LangChain and Infino:
This example shows how one can track the following while calling OpenAI and ChatOpenAI models via LangChain and Infino: ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksArgillaConfidentContextInfinoLabel StudioLLMonitorPromptLayerSageMaker TrackingStreamlitTrubricsChat loadersComponentsCallbacksInfinoOn this pageInfinoThis example shows how one can track the following while calling OpenAI and ChatOpenAI models via LangChain and Infino:prompt input,response from ChatGPT or any other LangChain model,latency,errors,number of tokens consumedInitializing‚Äã# Install necessary dependencies.pip install -q infinopypip install -q matplotlibpip install -q tiktokenimport datetime as dtimport jsonfrom langchain.llms import OpenAIimport matplotlib.pyplot as pltimport matplotlib.dates as mdimport osimport timeimport sysfrom infinopy import InfinoClientfrom langchain.callbacks import InfinoCallbackHandlerStart Infino server, initialize the Infino client‚Äã# Start server using the Infino docker image.docker run --rm --detach --name infino-example -p 3000:3000 infinohq/infino:latest# Create Infino client.client = InfinoClient()    a1159e99c6bdb3101139157acee6aba7ae9319375e77ab6fbc79beff75abeca3Read the questions dataset‚Äã# These are a subset of questions from Stanford's QA dataset -# https://rajpurkar.github.io/SQuAD-explorer/data = """In what country is Normandy located?When were the Normans in Normandy?From which countries did the Norse originate?Who was the Norse leader?What century did the Normans first gain their separate identity?Who gave their name to Normandy in the 1000's and 1100'sWhat is France a region of?Who did King Charles III swear fealty to?When did the Frankish identity emerge?Who was the duke in the battle of Hastings?Who ruled the duchy of NormandyWhat religion were the NormansWhat type of major impact did the Norman