motleycrew.common.llms
Helper functions to initialize Language Models (LLMs) from different frameworks.
Functions
|
Initialize an LLM client for use with the specified framework and family. |
|
Initialize an Anthropic LLM client for use with Langchain. |
|
Initialize a Groq LLM client for use with Langchain. |
|
Initialize an Ollama LLM client for use with Langchain. |
|
Initialize an OpenAI LLM client for use with Langchain. |
|
Initialize a Replicate LLM client for use with Langchain. |
|
Initialize a Together LLM client for use with Langchain. |
|
Initialize an Anthropic LLM client for use with LlamaIndex. |
|
Initialize a Groq LLM client for use with LlamaIndex. |
|
Initialize an Ollama LLM client for use with LlamaIndex. |
|
Initialize an OpenAI LLM client for use with LlamaIndex. |
|
Initialize a Replicate LLM client for use with LlamaIndex. |
|
Initialize a Together LLM client for use with LlamaIndex. |
- motleycrew.common.llms.langchain_openai_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an OpenAI LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in OpenAI API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_openai_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an OpenAI LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in OpenAI API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.langchain_anthropic_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an Anthropic LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in Anthropic API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_anthropic_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an Anthropic LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in Anthropic API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.langchain_replicate_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Replicate LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in Replicate API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_replicate_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Replicate LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in Replicate API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.langchain_together_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Together LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in Together API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_together_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Together LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in Together API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.langchain_groq_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Groq LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in Groq API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_groq_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize a Groq LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in Groq API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.langchain_ollama_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an Ollama LLM client for use with Langchain.
- Parameters:
llm_name – Name of the LLM in Ollama API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.llama_index_ollama_llm(llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an Ollama LLM client for use with LlamaIndex.
- Parameters:
llm_name – Name of the LLM in Ollama API.
llm_temperature – Temperature for the LLM.
- motleycrew.common.llms.init_llm(llm_framework: str, llm_provider: str = 'openai', llm_name: str = 'gpt-4o', llm_temperature: float = 0.0, **kwargs)
Initialize an LLM client for use with the specified framework and family.
- Parameters:
llm_framework – Framework of the LLM client.
llm_provider – Provider of the LLM.
llm_name – Name of the LLM.
llm_temperature – Temperature for the LLM.