Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsCallbacksModulesSecurityGuidesAdaptersDebuggingDeploymentEvaluationFallbacksLangSmithRun LLMs locallyModel comparisonPrivacyPydantic compatibilitySafetyMoreGuidesModel comparisonModel comparisonConstructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way. LangChain provides the concept of a ModelLaboratory to test out and try different models.from langchain.chains import LLMChainfrom langchain.llms import OpenAI, Cohere, HuggingFaceHubfrom langchain.prompts import PromptTemplatefrom langchain.model_laboratory import ModelLaboratoryllms = [    OpenAI(temperature=0),    Cohere(model="command-xlarge-20221108", max_tokens=20, temperature=0),    HuggingFaceHub(repo_id="google/flan-t5-xl", model_kwargs={"temperature": 1}),]model_lab = ModelLaboratory.from_llms(llms)model_lab.compare("What color is a flamingo?")    Input:    What color is a flamingo?        OpenAI    Params: {'model': 'text-davinci-002', 'temperature': 0.0, 'max_tokens': 256, 'top_p': 1, 'frequency_penalty': 0, 'presence_penalty': 0, 'n': 1, 'best_of': 1}            Flamingos are pink.        Cohere    Params: {'model': 'command-xlarge-20221108', 'max_tokens': 20, 'temperature': 0.0, 'k': 0, 'p': 1, 'frequency_penalty': 0, 'presence_penalty': 0}            Pink        HuggingFaceHub    Params: {'repo_id': 'google/flan-t5-xl', 'temperature': 1}    pink    prompt = PromptTemplate(    template="What is the capital of {state}?", input_variables=["state"])model_lab_with_prompt =
Constructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way.
Constructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsCallbacksModulesSecurityGuidesAdaptersDebuggingDeploymentEvaluationFallbacksLangSmithRun LLMs locallyModel comparisonPrivacyPydantic compatibilitySafetyMoreGuidesModel comparisonModel comparisonConstructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way. LangChain provides the concept of a ModelLaboratory to test out and try different models.from langchain.chains import LLMChainfrom langchain.llms import OpenAI, Cohere, HuggingFaceHubfrom langchain.prompts import PromptTemplatefrom langchain.model_laboratory import ModelLaboratoryllms = [    OpenAI(temperature=0),    Cohere(model="command-xlarge-20221108", max_tokens=20, temperature=0),    HuggingFaceHub(repo_id="google/flan-t5-xl", model_kwargs={"temperature": 1}),]model_lab = ModelLaboratory.from_llms(llms)model_lab.compare("What color is a flamingo?")    Input:    What color is a flamingo?        OpenAI    Params: {'model': 'text-davinci-002', 'temperature': 0.0, 'max_tokens': 256, 'top_p': 1, 'frequency_penalty': 0, 'presence_penalty': 0, 'n': 1, 'best_of': 1}            Flamingos are pink.        Cohere    Params: {'model': 'command-xlarge-20221108', 'max_tokens': 20, 'temperature': 0.0, 'k': 0, 'p': 1, 'frequency_penalty': 0, 'presence_penalty': 0}            Pink        HuggingFaceHub    Params: {'repo_id': 'google/flan-t5-xl', 'temperature': 1}    pink    prompt = PromptTemplate(    template="What is the capital of {state}?", input_variables=["state"])model_lab_with_prompt =