> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmcontrols.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Model components in LLM Controls

Model components generate text using large language models.

Refer to your specific component's documentation for more information on parameters.

## **Use a model component in a flow**

Model components receive inputs and prompts for generating text, and the generated text is sent to an output component.

The model output can also be sent to the **Language Model** port and on to a **Parse Data** component, where the output can be parsed into structured [Data](/Concepts/LLMCobjects) objects.

This example has the OpenAI model in a chatbot flow.

<img src="https://mintcdn.com/devrel/3c4Ck_HlevcLlxoS/images/basic_prompting.png?fit=max&auto=format&n=3c4Ck_HlevcLlxoS&q=85&s=aa2f8749a321e09cb813b71b7c465941" alt="Basic Prompting Pn" width="958" height="786" data-path="images/basic_prompting.png" />

## **LLMC Executor**

The LLMC Executor is a user-friendly interface designed to streamline interactions with AI language models, such as those from OpenAI. It plays a central role in allowing users to experiment with different prompts and models to generate high-quality AI responses.

By integrating with API keys, the executor enables seamless communication with external AI services.

Users can effortlessly select prompts , either manually or through integration with a Prompt Optimizer Flow and choose from available AI models using intuitive dropdown menus.

Once configured, the tool provides a clean and efficient workflow where users input text, trigger the request with a single click, and receive intelligent outputs in real-time.

This makes LLMC Executor an essential component for testing, optimizing, and comparing AI-generated responses across various configurations. 

### Key usage highlights

1.  **Prompt & Model Selection**: Choose from a set of predefined prompts and models using dropdowns. Your selections are automatically displayed for clarity.
2.  **Secure API Access**: Enter your API key to enable access to the chosen model. This is required for the tool to work.

   <img src="https://mintcdn.com/devrel/9PuWEwunOBJ8KxNm/images/llmc_executor.png?fit=max&auto=format&n=9PuWEwunOBJ8KxNm&q=85&s=f73cae19c295cb0ca9a901e67d539d95" alt="Llmc Executor Pn" width="274" height="438" data-path="images/llmc_executor.png" />

## **AIML**

This component creates a ChatOpenAI model instance using the AIML API.

For more information, see [AIML documentation](https://docs.aimlapi.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**        | **Type**     | **Description**                                                                           |
  | :-------------- | :----------- | :---------------------------------------------------------------------------------------- |
  | max\_tokens     | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens. Range: 0-128000. |
  | model\_kwargs   | Dictionary   | Additional keyword arguments for the model.                                               |
  | model\_name     | String       | The name of the AIML model to use. Options are predefined in `AIML_CHAT_MODELS`.          |
  | aiml\_api\_base | String       | The base URL of the AIML API. Defaults to `https://api.aimlapi.com`.                      |
  | api\_key        | SecretString | The AIML API Key to use for the model.                                                    |
  | temperature     | Float        | Controls randomness in the output. Default: `0.1`.                                        |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                     |
  | :------- | :------------ | :------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |
</Accordion>

## **Amazon Bedrock**

This component generates text using Amazon Bedrock LLMs.

For more information, see [Amazon Bedrock documentation](https://docs.aws.amazon.com/bedrock).

<Accordion title="Parameters">
  **Inputs**

  | **Name**                   | **Type**     | **Description**                                                            |
  | :------------------------- | :----------- | :------------------------------------------------------------------------- |
  | model\_id                  | String       | The ID of the Amazon Bedrock model to use. Options include various models. |
  | aws\_access\_key           | SecretString | AWS Access Key for authentication.                                         |
  | aws\_secret\_key           | SecretString | AWS Secret Key for authentication.                                         |
  | aws\_session\_token        | SecretString | The session key for your AWS account.                                      |
  | credentials\_profile\_name | String       | Name of the AWS credentials profile to use.                                |
  | region\_name               | String       | AWS region name. Default: `us-east-1`.                                     |
  | model\_kwargs              | Dictionary   | Additional keyword arguments for the model.                                |
  | endpoint\_url              | String       | Custom endpoint URL for the Bedrock service.                               |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                      |
  | :------- | :------------ | :------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatBedrock configured with the specified parameters. |
</Accordion>

## **Anthropic**

This component allows the generation of text using Anthropic Chat and Language models.

For more information, see the [Anthropic documentation](https://docs.anthropic.com/en/docs/welcome).

<Accordion title="Parameters">
  **Inputs**

  | **Name**            | **Type**     | **Description**                                                                                     |
  | :------------------ | :----------- | :-------------------------------------------------------------------------------------------------- |
  | max\_tokens         | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens. Default: `4096`.           |
  | model               | String       | The name of the Anthropic model to use. Options include various Claude 3 models.                    |
  | anthropic\_api\_key | SecretString | Your Anthropic API key for authentication.                                                          |
  | temperature         | Float        | Controls randomness in the output. Default: `0.1`.                                                  |
  | anthropic\_api\_url | String       | Endpoint of the Anthropic API. Defaults to `https://api.anthropic.com` if not specified (advanced). |
  | prefill             | String       | Prefill text to guide the model's response (advanced).                                              |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                        |
  | :------- | :------------ | :--------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatAnthropic configured with the specified parameters. |
</Accordion>

## **Azure OpenAI**

This component generates text using Azure OpenAI LLM.

For more information, see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**        | **Type**     | **Description**                                                               |
  | :-------------- | :----------- | :---------------------------------------------------------------------------- |
  | Model Name      | String       | Specifies the name of the Azure OpenAI model to be used for text generation.  |
  | Azure Endpoint  | String       | Your Azure endpoint, including the resource.                                  |
  | Deployment Name | String       | Specifies the name of the deployment.                                         |
  | API Version     | String       | Specifies the version of the Azure OpenAI API to be used.                     |
  | API Key         | SecretString | Your Azure OpenAI API key.                                                    |
  | Temperature     | Float        | Specifies the sampling temperature. Defaults to `0.7`.                        |
  | Max Tokens      | Integer      | Specifies the maximum number of tokens to generate. Defaults to `1000`.       |
  | Input Value     | String       | Specifies the input text for text generation.                                 |
  | Stream          | Boolean      | Specifies whether to stream the response from the model. Defaults to `False`. |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                      |
  | :------- | :------------ | :------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of AzureOpenAI configured with the specified parameters. |
</Accordion>

## **Cohere**

This component generates text using Cohere's language models.

For more information, see the [Cohere documentation](https://cohere.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**       | **Type**     | **Description**                                                        |
  | :------------- | :----------- | :--------------------------------------------------------------------- |
  | Cohere API Key | SecretString | Your Cohere API key.                                                   |
  | Max Tokens     | Integer      | Specifies the maximum number of tokens to generate. Defaults to `256`. |
  | Temperature    | Float        | Specifies the sampling temperature. Defaults to `0.75`.                |
  | Input Value    | String       | Specifies the input text for text generation.                          |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                           |
  | :------- | :------------ | :------------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of the Cohere model configured with the specified parameters. |
</Accordion>

## **DeepSeek**

This component generates text using DeepSeek's language models.

For more information, see the [DeepSeek documentation](https://api-docs.deepseek.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**      | **Type**     | **Description**                                                                                                                                                    |
  | :------------ | :----------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | max\_tokens   | Integer      | Maximum number of tokens to generate. Set to `0` for unlimited. Range: `0-128000`.                                                                                 |
  | model\_kwargs | Dictionary   | Additional keyword arguments for the model.                                                                                                                        |
  | json\_mode    | Boolean      | If `True`, outputs JSON regardless of passing a schema.                                                                                                            |
  | model\_name   | String       | The DeepSeek model to use. Default: `deepseek-chat`.                                                                                                               |
  | api\_base     | String       | Base URL for API requests. Default: `https://api.deepseek.com`.                                                                                                    |
  | api\_key      | SecretString | Your DeepSeek API key for authentication.                                                                                                                          |
  | temperature   | Float        | Controls randomness in responses. Range: `[0.0, 2.0]`. Default: `1.0`.                                                                                             |
  | seed          | Integer      | Number initialized for random number generation. Use the same seed integer for more reproducible results, and use a different seed number for more random results. |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                     |
  | :------- | :------------ | :------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |
</Accordion>

## **Google Generative AI**

This component generates text using Google's Generative AI models.

For more information, see the [Google Generative AI documentation](https://cloud.google.com/vertex-ai/docs/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**          | **Type**     | **Description**                                                         |
  | :---------------- | :----------- | :---------------------------------------------------------------------- |
  | Google API Key    | SecretString | Your Google API key to use for the Google Generative AI.                |
  | Model             | String       | The name of the model to use, such as `"gemini-pro"`.                   |
  | Max Output Tokens | Integer      | The maximum number of tokens to generate.                               |
  | Temperature       | Float        | Run inference with this temperature.                                    |
  | Top K             | Integer      | Consider the set of top K most probable tokens.                         |
  | Top P             | Float        | The maximum cumulative probability of tokens to consider when sampling. |
  | N                 | Integer      | Number of chat completions to generate for each prompt.                 |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                                 |
  | :------- | :------------ | :------------------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatGoogleGenerativeAI configured with the specified parameters. |
</Accordion>

## **Groq**

This component generates text using Groq's language models.

1. To use this component in a flow, connect it as a **Model** in a flow like the [Basic prompting flow](/Templates/Basicprompting), or select it as the **Model Provider** if you're using an **Agent** component.

   <img src="https://mintcdn.com/devrel/9PuWEwunOBJ8KxNm/images/model_3.png?fit=max&auto=format&n=9PuWEwunOBJ8KxNm&q=85&s=12b9523fc85cdd159b1ea16cb73c300d" alt="Model 3 Pn" width="498" height="783" data-path="images/model_3.png" />
2. In the **Groq API Key** field, paste your Groq API key. The Groq model component automatically retrieves a list of the latest models. To refresh your list of models, click **Refresh**.
3. In the **Model** field, select the model you want to use for your LLM.
4. Click **Playground** and ask your Groq LLM a question. The responses include a list of sources.

For more information, see the [Groq documentation](https://groq.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**            | **Type**     | **Description**                                                                       |
  | :------------------ | :----------- | :------------------------------------------------------------------------------------ |
  | groq\_api\_key      | SecretString | API key for the Groq API.                                                             |
  | groq\_api\_base     | String       | Base URL path for API requests. Default: `https://api.groq.com`.                      |
  | max\_tokens         | Integer      | The maximum number of tokens to generate.                                             |
  | temperature         | Float        | Controls randomness in the output. Range: `[0.0, 1.0]`. Default: `0.1`.               |
  | n                   | Integer      | Number of chat completions to generate for each prompt.                               |
  | model\_name         | String       | The name of the Groq model to use. Options are dynamically fetched from the Groq API. |
  | tool\_mode\_enabled | Bool         | If enabled, the component only displays models that work with tools.                  |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                   |
  | :------- | :------------ | :---------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatGroq configured with the specified parameters. |
</Accordion>

## **Hugging Face API**

This component sends requests to the Hugging Face API to generate text using the model specified in the **Model ID** field.

The Hugging Face API is a hosted inference API for models hosted on Hugging Face, and requires a [Hugging Face API token](https://huggingface.co/docs/hub/security-tokens) to authenticate.

```text theme={null}

from llmc.components.inputs import ChatInput
from llmc.components.models import HuggingFaceEndpointsComponent
from llmc.components.outputs import ChatOutput
from llmc.components.prompts import PromptComponent
from llmc.graph import Graph

def basic_prompting_with_huggingface():
    # Create chat input
    chat_input = ChatInput()
    
    # Create prompt component
    prompt_component = PromptComponent()
    prompt_component.set(
        template="Answer the user as if you were a GenAI expert.\n\nUser: {user_input}\n\nAnswer:",
        user_input=chat_input.message_response,
    )
    
    # Replace OpenAI with Hugging Face API model
    huggingface_component = HuggingFaceEndpointsComponent()
    # Set your Hugging Face API token in the huggingfacehub_api_token field
    # Select a model from the Model ID dropdown (e.g., "meta-llama/Llama-3.3-70B-Instruct")
    huggingface_component.set(input_value=prompt_component.build_prompt)
    
    # Create chat output
    chat_output = ChatOutput()
    chat_output.set(input_value=huggingface_component.text_response)
    
    graph = Graph(start=chat_input, end=chat_output)
    return graph
```

In this example based on the [Basic prompting flow](/Templates/Basicprompting), the **Hugging Face API** model component replaces the **Open AI** model. By selecting different hosted models, you can see how different models return different results.

### Steps to use Hugging Face API in Basic prompting flow:

1. Create a Basic prompting flow.
2. Replace the OpenAI model component with a Hugging Face API model component.
3. In the Hugging Face API component, add your Hugging Face API token to the API Token field.
4. Select a model from the Model ID dropdown (**e.g.,** meta-llama/Llama-3.3-70B-Instruct).
5. Open the Playground and ask a question to the model, and see how it responds.
6. Try different models, and see how they perform differently.

For more information, see the [Hugging Face documentation](https://huggingface.co/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**                   | **Type**     | **Description**                                                                 |
  | :------------------------- | :----------- | :------------------------------------------------------------------------------ |
  | model\_id                  | String       | The model ID from Hugging Face Hub. For example, "gpt2", "facebook/bart-large". |
  | huggingfacehub\_api\_token | SecretString | Your Hugging Face API token for authentication.                                 |
  | temperature                | Float        | Controls randomness in the output. Range: \[0.0, 1.0]. Default: 0.7.            |
  | max\_new\_tokens           | Integer      | Maximum number of tokens to generate. Default: 512.                             |
  | top\_p                     | Float        | Nucleus sampling parameter. Range: \[0.0, 1.0]. Default: 0.95.                  |
  | top\_k                     | Integer      | Top-k sampling parameter. Default: 50.                                          |
  | model\_kwargs              | Dictionary   | Additional keyword arguments to pass to the model.                              |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                         |
  | :------- | :------------ | :---------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of HuggingFaceHub configured with the specified parameters. |
</Accordion>

## IBM watsonx.ai

This component generates text using IBM WatsonX.ai  foundation models.

To use IBM [**watsonx.ai**](http://watsonx.ai) model components, replace a model component with the IBM watsonx.ai component in a flow.

An example flow looks like the following:

<img src="https://mintcdn.com/devrel/9PuWEwunOBJ8KxNm/images/model_4.png?fit=max&auto=format&n=9PuWEwunOBJ8KxNm&q=85&s=689407dfbbaba8ca94577a19ceb5ed5b" alt="Model 4 Pn" width="397" height="779" data-path="images/model_4.png" />

The values for **API endpoint**, **Project ID**, **API key**, and **Model Name** are found in your IBM watsonx.ai deployment. For more information, see the [Langchain documentation](https://python.langchain.com/docs/integrations/chat/ibm_watsonx/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**           | **Type**     | **Description**                                                                                                                                                    |
  | :----------------- | :----------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | url                | String       | The base URL of the watsonx API.                                                                                                                                   |
  | project\_id        | String       | Your watsonx Project ID.                                                                                                                                           |
  | api\_key           | SecretString | Your IBM watsonx API Key.                                                                                                                                          |
  | model\_name        | String       | The name of the watsonx model to use. Options are dynamically fetched from the API.                                                                                |
  | max\_tokens        | Integer      | The maximum number of tokens to generate. Default: `1000`.                                                                                                         |
  | stop\_sequence     | String       | The sequence where generation should stop.                                                                                                                         |
  | temperature        | Float        | Controls randomness in the output. Default: `0.1`.                                                                                                                 |
  | top\_p             | Float        | Controls nucleus sampling, which limits the model to tokens whose probability is below the `top_p` value. Range: Default: `0.9`.                                   |
  | frequency\_penalty | Float        | Controls frequency penalty. A positive value decreases the probability of repeating tokens, and a negative value increases the probability. Range: Default: `0.5`. |
  | presence\_penalty  | Float        | Controls presence penalty. A positive value increases the likelihood of new topics being introduced. Default: `0.3`.                                               |
  | seed               | Integer      | A random seed for the model. Default: `8`.                                                                                                                         |
  | logprobs           | Boolean      | Whether to return log probabilities of output tokens or not. Default: `True`.                                                                                      |
  | top\_logprobs      | Integer      | The number of most likely tokens to return at each position. Default: `3`.                                                                                         |
  | logit\_bias        | String       | A JSON string of token IDs to bias or suppress.                                                                                                                    |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                                                                                                 |
  | :------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of [<u>ChatWatsonx</u>](https://python.langchain.com/docs/integrations/chat/ibm_watsonx/) configured with the specified parameters. |
</Accordion>

## **Language model**

This component generates text using either OpenAI or Anthropic language models.

Use this component as a drop-in replacement for LLM models to switch between different model providers and models.

Instead of swapping out model components when you want to try a different provider, like switching between OpenAI and Anthropic components, change the provider dropdown in this single component. This makes it easier to experiment with and compare different models while keeping the rest of your flow intact.

For more information, see the [OpenAI documentation](https://platform.openai.com/docs) and [Anthropic documentation](https://docs.anthropic.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**        | **Type**     | **Description**                                                                   |
  | :-------------- | :----------- | :-------------------------------------------------------------------------------- |
  | provider        | String       | The model provider to use. Options: "OpenAI", "Anthropic". Default: "OpenAI".     |
  | model\_name     | String       | The name of the model to use. Options depend on the selected provider.            |
  | api\_key        | SecretString | The API Key for authentication with the selected provider.                        |
  | input\_value    | String       | The input text to send to the model.                                              |
  | system\_message | String       | A system message that helps set the behavior of the assistant (advanced).         |
  | stream          | Boolean      | Whether to stream the response. Default: `False` (advanced).                      |
  | temperature     | Float        | Controls randomness in responses. Range: `[0.0, 1.0]`. Default: `0.1` (advanced). |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                                      |
  | :------- | :------------ | :----------------------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatOpenAI or ChatAnthropic configured with the specified parameters. |
</Accordion>

## **LMStudio**

This component generates text using LM Studio's local language models.

For more information, see [LM Studio documentation](https://lmstudio.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**           | **Type**      | **Description**                                                               |
  | :----------------- | :------------ | :---------------------------------------------------------------------------- |
  | base\_url          | String        | The URL where LM Studio is running. Default: `"http://localhost:1234"`.       |
  | max\_tokens        | Integer       | Maximum number of tokens to generate in the response. Default: `512`.         |
  | temperature        | Float         | Controls randomness in the output. Range: `[0.0, 2.0]`. Default: `0.7`.       |
  | top\_p             | Float         | Controls diversity via nucleus sampling. Range: `[0.0, 1.0]`. Default: `1.0`. |
  | stop               | List\[String] | List of strings that stop generation when encountered.                        |
  | stream             | Boolean       | Whether to stream the response. Default: `False`.                             |
  | presence\_penalty  | Float         | Penalizes repeated tokens. Range: `[-2.0, 2.0]`. Default: `0.0`.              |
  | frequency\_penalty | Float         | Penalizes frequent tokens. Range: `[-2.0, 2.0]`. Default: `0.0`.              |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                   |
  | :------- | :------------ | :---------------------------------------------------------------- |
  | model    | LanguageModel | An instance of LMStudio configured with the specified parameters. |
</Accordion>

## **Maritalk**

This component generates text using Maritalk LLMs.

For more information, see [Maritalk documentation](https://www.maritalk.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**      | **Type**     | **Description**                                                                                              |
  | :------------ | :----------- | :----------------------------------------------------------------------------------------------------------- |
  | max\_tokens   | Integer      | The maximum number of tokens to generate. Set to `0` for unlimited tokens. Default: `512`.                   |
  | model\_name   | String       | The name of the Maritalk model to use. Options: `sabia-2-small`, `sabia-2-medium`. Default: `sabia-2-small`. |
  | api\_key      | SecretString | The Maritalk API Key to use for authentication.                                                              |
  | temperature   | Float        | Controls randomness in the output. Range: `[0.0, 1.0]`. Default: `0.5`.                                      |
  | endpoint\_url | String       | The Maritalk API endpoint. Default: `https://api.maritalk.com`.                                              |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                       |
  | :------- | :------------ | :-------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatMaritalk configured with the specified parameters. |
</Accordion>

## **Mistral**

This component generates text using MistralAI LLMs.

For more information, see [Mistral AI documentation](https://docs.mistral.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**                  | **Type**     | **Description**                                                                                                                                                                                                                   |
  | :------------------------ | :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | max\_tokens               | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens (advanced).                                                                                                                                               |
  | model\_name               | String       | The name of the Mistral AI model to use. Options include `open-mixtral-8x7b`, `open-mixtral-8x22b`, `mistral-small-latest`, `mistral-medium-latest`, `mistral-large-latest`, and `codestral-latest`. Default: `codestral-latest`. |
  | mistral\_api\_base        | String       | The base URL of the Mistral API. Defaults to `https://api.mistral.ai/v1` (advanced).                                                                                                                                              |
  | api\_key                  | SecretString | The Mistral API Key to use for authentication.                                                                                                                                                                                    |
  | temperature               | Float        | Controls randomness in the output. Default: 0.5.                                                                                                                                                                                  |
  | max\_retries              | Integer      | Maximum number of retries for API calls. Default: 5 (advanced).                                                                                                                                                                   |
  | timeout                   | Integer      | Timeout for API calls in seconds. Default: 60 (advanced).                                                                                                                                                                         |
  | max\_concurrent\_requests | Integer      | Maximum number of concurrent API requests. Default: 3 (advanced).                                                                                                                                                                 |
  | top\_p                    | Float        | Nucleus sampling parameter. Default: 1 (advanced).                                                                                                                                                                                |
  | random\_seed              | Integer      | Seed for random number generation. Default: 1 (advanced).                                                                                                                                                                         |
  | safe\_mode                | Boolean      | Enables safe mode for content generation (advanced).                                                                                                                                                                              |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                        |
  | :------- | :------------ | :--------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatMistralAI configured with the specified parameters. |
</Accordion>

## **Novita AI**

This component generates text using Novita AI's language models.

For more information, see [Novita AI documentation](https://novita.ai/docs/model-api/reference/llm/llm.html?utm_source=github_langflow\&utm_medium=github_readme\&utm_campaign=link).

<Accordion title="Parameters">
  **Inputs**

  | **Name**           | **Type**     | **Description**                                                          |
  | :----------------- | :----------- | :----------------------------------------------------------------------- |
  | api\_key           | SecretString | Your Novita AI API Key.                                                  |
  | model              | String       | The id of the Novita AI model to use.                                    |
  | max\_tokens        | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens. |
  | temperature        | Float        | Controls randomness in the output. Range: \[0.0, 1.0]. Default: 0.7.     |
  | top\_p             | Float        | Controls the nucleus sampling. Range: \[0.0, 1.0]. Default: 1.0.         |
  | frequency\_penalty | Float        | Controls the frequency penalty. Range: \[0.0, 2.0]. Default: 0.0.        |
  | presence\_penalty  | Float        | Controls the presence penalty. Range: \[0.0, 2.0]. Default: 0.0.         |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                          |
  | :------- | :------------ | :----------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of Novita AI model configured with the specified parameters. |
</Accordion>

## **NVIDIA**

This component generates text using NVIDIA LLMs.

For more information, see [NVIDIA AI documentation](https://developer.nvidia.com/generative-ai).

<Accordion title="Parameters">
  **Inputs**

  | **Name**         | **Type**     | **Description**                                                                       |
  | :--------------- | :----------- | :------------------------------------------------------------------------------------ |
  | max\_tokens      | Integer      | The maximum number of tokens to generate. Set to `0` for unlimited tokens (advanced). |
  | model\_name      | String       | The name of the NVIDIA model to use. Default: `mistralai/mixtral-8x7b-instruct-v0.1`. |
  | base\_url        | String       | The base URL of the NVIDIA API. Default: `https://integrate.api.nvidia.com/v1`.       |
  | nvidia\_api\_key | SecretString | The NVIDIA API Key for authentication.                                                |
  | temperature      | Float        | Controls randomness in the output. Default: `0.1`.                                    |
  | seed             | Integer      | The seed controls the reproducibility of the job (advanced). Default: `1`.            |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                     |
  | :------- | :------------ | :------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatNVIDIA configured with the specified parameters. |
</Accordion>

## **Ollama**

This component generates text using Ollama's language models.

To use this component in a flow, connect LLM Controls to your locally running Ollama server and select a model.

1. In the Ollama component, in the **Base URL** field, enter the address for your locally running Ollama server. This value is set as the `OLLAMA_HOST` environment variable in Ollama. The default base URL is `http://localhost:11434`.
2. To refresh the server's list of models, click **Refresh**.
3. In the **Model Name** field, select a model. This example uses `llama3.2:latest`.
4. Connect the **Ollama** model component to a flow. For example, this flow connects a local Ollama server running a Llama 3.2 model as the custom model for an [Agent](/Components/Agents) component.

   <img src="https://mintcdn.com/devrel/9PuWEwunOBJ8KxNm/images/model_5.png?fit=max&auto=format&n=9PuWEwunOBJ8KxNm&q=85&s=8c435e81a7076631f5be25f982ba832a" alt="Model 5 Pn" width="475" height="756" data-path="images/model_5.png" />

For more information, see the [Ollama documentation](https://ollama.com/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**    | **Type** | **Description**                             |
  | :---------- | :------- | :------------------------------------------ |
  | Base URL    | String   | Endpoint of the Ollama API.                 |
  | Model Name  | String   | The model name to use.                      |
  | Temperature | Float    | Controls the creativity of model responses. |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                          |
  | :------- | :------------ | :----------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of an Ollama model configured with the specified parameters. |
</Accordion>

## **OpenAI**

This component generates text using OpenAI's language models.

For more information, see [OpenAI documentation](https://beta.openai.com/docs/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**           | **Type**     | **Description**                                                                   |
  | :----------------- | :----------- | :-------------------------------------------------------------------------------- |
  | api\_key           | SecretString | Your OpenAI API Key.                                                              |
  | model              | String       | The name of the OpenAI model to use. Options include "gpt-3.5-turbo" and "gpt-4". |
  | max\_tokens        | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens.          |
  | temperature        | Float        | Controls randomness in the output. Range: \[0.0, 1.0]. Default: 0.7.              |
  | top\_p             | Float        | Controls the nucleus sampling. Range: \[0.0, 1.0]. Default: 1.0.                  |
  | frequency\_penalty | Float        | Controls the frequency penalty. Range: \[0.0, 2.0]. Default: 0.0.                 |
  | presence\_penalty  | Float        | Controls the presence penalty. Range: \[0.0, 2.0]. Default: 0.0.                  |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                       |
  | :------- | :------------ | :-------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of OpenAI model configured with the specified parameters. |
</Accordion>

## **OpenRouter**

This component generates text using OpenRouter's unified API for multiple AI models from different providers.

For more information, see [OpenRouter documentation](https://openrouter.ai/docs).

<Accordion title="Parameters">
  **Inputs**

  | **Name**    | **Type**     | **Description**                                                      |
  | :---------- | :----------- | :------------------------------------------------------------------- |
  | api\_key    | SecretString | Your OpenRouter API key for authentication.                          |
  | site\_url   | String       | Your site URL for OpenRouter rankings (advanced).                    |
  | app\_name   | String       | Your app name for OpenRouter rankings (advanced).                    |
  | provider    | String       | The AI model provider to use.                                        |
  | model\_name | String       | The specific model to use for chat completion.                       |
  | temperature | Float        | Controls randomness in the output. Range: \[0.0, 2.0]. Default: 0.7. |
  | max\_tokens | Integer      | The maximum number of tokens to generate (advanced).                 |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                     |
  | :------- | :------------ | :------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |
</Accordion>

## **Perplexity**

This component generates text using Perplexity's language models.

For more information, see [Perplexity documentation](https://perplexity.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**            | **Type**     | **Description**                                                                    |
  | :------------------ | :----------- | :--------------------------------------------------------------------------------- |
  | model\_name         | String       | The name of the Perplexity model to use. Options include various Llama 3.1 models. |
  | max\_output\_tokens | Integer      | The maximum number of tokens to generate.                                          |
  | api\_key            | SecretString | The Perplexity API Key for authentication.                                         |
  | temperature         | Float        | Controls randomness in the output. Default: 0.75.                                  |
  | top\_p              | Float        | The maximum cumulative probability of tokens to consider when sampling (advanced). |
  | n                   | Integer      | Number of chat completions to generate for each prompt (advanced).                 |
  | top\_k              | Integer      | Number of top tokens to consider for top-k sampling. Must be positive (advanced).  |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                         |
  | :------- | :------------ | :---------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatPerplexity configured with the specified parameters. |
</Accordion>

## **Qianfan**

This component generates text using Qianfan's language models.

For more information, see [Qianfan documentation](https://github.com/baidubce/bce-qianfan-sdk).

<Accordion title="Parameters">
  **Inputs**

  | Name            | Display Name   | Info                                                                                                                                                                                                                                                                               |
  | :-------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | input\_value    | Input          | (inherited from base)                                                                                                                                                                                                                                                              |
  | system\_message | System Message | System message to pass to the model.                                                                                                                                                                                                                                               |
  | stream          | Stream         | (inherited from base, advanced)                                                                                                                                                                                                                                                    |
  | model           | Model Name     | Options: ERNIE-4.0-8K, ERNIE-3.5-8K, ERNIE-Bot, ERNIE-Bot-4, ERNIE-Bot-turbo-AI, ERNIE-Speed, ERNIE-Speed-8K, ERNIE-Speed-128k, ERNIE-Lite-8K-0308, Llama-2-70b-chat, Llama-2-13b-chat, Llama-2-7b-chat, Mixtral-8x7B-Instruct, Yi-34B-Chat, ChatGLM2-6B-32K, BLOOMZ-7B, and more. |
  | qianfan\_ak     | Qianfan Ak     | Which you could get from [<u>https://cloud.baidu.com/product/wenxinworkshop</u>](https://cloud.baidu.com/product/wenxinworkshop)                                                                                                                                                   |
  | qianfan\_sk     | Qianfan Sk     | Which you could get from [<u>https://cloud.baidu.com/product/wenxinworkshop</u>](https://cloud.baidu.com/product/wenxinworkshop)                                                                                                                                                   |
  | top\_p          | Top p          | Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. Default: 0.8.                                                                                                                                                                                                       |
  | temperature     | Temperature    | Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. Default: 0.95.                                                                                                                                                                                                      |
  | penalty\_score  | Penalty Score  | Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. Default: 1.0.                                                                                                                                                                                                       |
  | endpoint        | Endpoint       | Endpoint of the Qianfan LLM, required if custom model used.                                                                                                                                                                                                                        |

  **Outputs**

  | Name          | Display Name   | Info                                                                   |
  | :------------ | :------------- | :--------------------------------------------------------------------- |
  | text\_output  | Message        | Model response as a Message object.                                    |
  | model\_output | Language Model | An instance of Qianfan model configured with the specified parameters. |
</Accordion>

## **SambaNova**

This component generates text using SambaNova LLMs.

For more information, see [Sambanova Cloud documentation](https://cloud.sambanova.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**            | **Type**     | **Description**                                                                          |
  | :------------------ | :----------- | :--------------------------------------------------------------------------------------- |
  | sambanova\_url      | String       | Base URL path for API requests. Default: `https://api.sambanova.ai/v1/chat/completions`. |
  | sambanova\_api\_key | SecretString | Your SambaNova API Key.                                                                  |
  | model\_name         | String       | The name of the Sambanova model to use. Options include various Llama models.            |
  | max\_tokens         | Integer      | The maximum number of tokens to generate. Set to 0 for unlimited tokens.                 |
  | temperature         | Float        | Controls randomness in the output. Range: \[0.0, 1.0]. Default: 0.07.                    |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                          |
  | :------- | :------------ | :----------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of SambaNova model configured with the specified parameters. |
</Accordion>

## **VertexAI**

This component generates text using Vertex AI LLMs.

For more information, see [Google Vertex AI documentation](https://cloud.google.com/vertex-ai).

<Accordion title="Parameters">
  **Inputs**

  | **Name**            | **Type** | **Description**                                                                                                                       |
  | :------------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------ |
  | credentials         | File     | JSON credentials file. Leave empty to fall back to environment variables. File type: JSON.                                            |
  | model\_name         | String   | The name of the Vertex AI model to use. Default: "gemini-1.5-pro".                                                                    |
  | project             | String   | The project ID (advanced).                                                                                                            |
  | location            | String   | The location for the Vertex AI API. Default: "us-central1" (advanced).                                                                |
  | max\_output\_tokens | Integer  | The maximum number of tokens to generate (advanced).                                                                                  |
  | max\_retries        | Integer  | Maximum number of retries for API calls. Default: 1 (advanced).                                                                       |
  | temperature         | Float    | Controls randomness in the output. Default: 0.0.                                                                                      |
  | top\_k              | Integer  | The number of highest probability vocabulary tokens to keep for top-k-filtering (advanced).                                           |
  | top\_p              | Float    | The cumulative probability of parameter highest probability vocabulary tokens to keep for nucleus sampling. Default: 0.95 (advanced). |
  | verbose             | Boolean  | Whether to print verbose output. Default: False (advanced).                                                                           |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                       |
  | :------- | :------------ | :-------------------------------------------------------------------- |
  | model    | LanguageModel | An instance of ChatVertexAI configured with the specified parameters. |
</Accordion>

## **xAI**

This component generates text using xAI models like [Grok](https://x.ai/grok).

For more information, see the [xAI documentation](https://x.ai/).

<Accordion title="Parameters">
  **Inputs**

  | **Name**      | **Type**     | **Description**                                                                    |
  | :------------ | :----------- | :--------------------------------------------------------------------------------- |
  | max\_tokens   | Integer      | Maximum number of tokens to generate. Set to `0` for unlimited. Range: `0-128000`. |
  | model\_kwargs | Dictionary   | Additional keyword arguments for the model.                                        |
  | json\_mode    | Boolean      | If `True`, outputs JSON regardless of passing a schema.                            |
  | model\_name   | String       | The xAI model to use. Default: `grok-2-latest`.                                    |
  | base\_url     | String       | Base URL for API requests. Default: `https://api.x.ai/v1`.                         |
  | api\_key      | SecretString | Your xAI API key for authentication.                                               |
  | temperature   | Float        | Controls randomness in the output. Range: `[0.0, 2.0]`. Default: `0.1`.            |
  | seed          | Integer      | Controls reproducibility of the job.                                               |

  **Outputs**

  | **Name** | **Type**      | **Description**                                                     |
  | :------- | :------------ | :------------------------------------------------------------------ |
  | model    | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |
</Accordion>

## **DALL-E 3**

This component generates images using OpenAI's DALL-E 3 model. It accepts a text prompt and returns the generated image as a URL, base64-encoded data, or a Message with generation details.

<Accordion title="Parameters">
  **Inputs**

  | Name              | Display Name     | Info                                                                                                                                                          |
  | :---------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | prompt            | Prompt           | A text description of the desired image(s).                                                                                                                   |
  | model             | Model            | The model to use for image generation.                                                                                                                        |
  | size              | Size             | The size of the generated images.                                                                                                                             |
  | quality           | Quality          | The quality of the generated images. 'hd' creates more detailed images but costs more.                                                                        |
  | style             | Style            | The style of the generated images. 'vivid' favors vibrant colors and high contrast, while 'natural' produces more realistic images with less stylized colors. |
  | n                 | Number of Images | The number of images to generate. Maximum is 1 for DALL-E 3.                                                                                                  |
  | openai\_api\_base | OpenAI API Base  | The base URL of the OpenAI API.                                                                                                                               |
  | api\_key          | OpenAI API Key   | The OpenAI API Key to use for the OpenAI model.                                                                                                               |

  #### Outputs

  | Name           | Display Name     | Info                                                           |
  | :------------- | :--------------- | :------------------------------------------------------------- |
  | image\_url     | Image URL        | The URL of the first generated image.                          |
  | images\_base64 | Images as base64 | The generated images as a list of base64-encoded strings.      |
  | message        | Message          | A Message object containing generation details and image URLs. |
</Accordion>
