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

# Create and deploy custom models

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[old doc.lw link]: https://doc.lucidworks.com/lw-platform/ai/vjs5ie

[localhost link]: http://localhost:3000/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/create-and-deploy-custom-models

[mintlify link]: https://doc.lucidworks.com/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/create-and-deploy-custom-models

This topic details procedures to create a new custom model and deploy existing custom models.

For information about custom models, see [Custom model training user interface](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-model-training-user-interface).

<LwTemplate />

## Create a new model

To create a new model, navigate to the megamenu and click **Models > Custom Models**.

1. In the Custom Models screen, click **+ Create New Model**.
2. In the Train New Model screen, enter a user-defined value in the **Name** field, select a **Region** where the training of the model occurs, and click **Continue**.

   <Note>These fields cannot be changed after the model is created. If you need a different name or a model in a different region, you must create another model with the new information.</Note>
3. Click one of the following values for the **Use Case**:

   * **General.** This use case uses general data schema with `mrr@3` as the primary retrieval metric. This option is typically for informational sites.
   * **ecommerce.** This use case uses ecommerce catalog and signals data schema with `ndcg@5` as the primary retrieval metric. This option is typically used for online sales sites.
   * **Classification.** This use case uses classification data schema for texts labeling with `F1` scores as the primary evaluation metric. This option is used to compute similarity scores between the incoming text and the labels.
   * **Part Number Classification.** This use case for part number detection uses the Part Number Classification data schema for texts labeling with `F1` scores as a main evaluation metric. This option detects if the input is a part number. For more information, see [Custom embedding model use case training data](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-model-training-data).

<Note>
  If your Google Cloud Storage (GCS) bucket is publicly accessible, the service account key is optional and you can click **Continue** without entering a key. If you enter a key, it is validated when you click **Continue**. If the key is not valid, the model cannot be configured.
</Note>

4. In the Query Training Data field, enter the location of signals in the training data in Google Cloud Storage (GCS). For configuration information, see [use case training data query file](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-model-training-data#query-file).
5. In the Index Training Data field, enter the location of the index training data in Google Cloud Storage (GCS). For configuration information, see [use case training data index file](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-model-training-data).
6. In the Upload Service Account Key section, the information about how to generate your service account key. To upload a JSON blob that contains the default information from GCS, click **Click here to browse** and select the JSON file. To view an example, click **Sample Service Account Key**.

   <Note>If your Google Cloud Storage (GCS) bucket is publicly accessible, the service account key is optional and you can click **Continue** without entering a key. If you enter a key, it is validated when you click **Continue**. If the key is not valid, the model cannot be configured.</Note>
7. Click **Continue**.
8. Click one of the following values for the **Model Type**:

   * **General RNN.** This model type is the RNN encoder with frozen pre-trained token embeddings. The general model is typically used by knowledge management sites that contain information, such as news or documentation. For more information about this model, see [custom embedding models](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-rnn-models).
   * **ecommerce RNN.** This model type is the RNN encoder with tuneable token embeddings. The ecommerce model is typically used by sites that provide products for purchase. For more information about this model, see [custom embedding models](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-rnn-models).
   * **Transformer RNN.** This model is the RNN built on top of a frozen pre-trained Transformer (BERT) encoder. This model is typically used for ecommerce use cases due to slower model encoding speed and less flexibility for domain specific language. For more information about this model, see [Transformer RNN models](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-transformer-rnn-models).
9. Select values in the following fields:

   * **Text Processor Config.** The type of tokenization and embedding to be used as the base for the selected recurrent neural network (RNN) model type. For example, word or byte-pair encoding (BPE). For information about values, see [Text processor](/docs/lw-platform/lw-ai/lw-ai-custom-embedding-model-training/custom-embedding-rnn-models#text-processor).
   * **RNN Layers.** In Layer 1 of the RNN Layers field, select the bi-directional recurrent neural network (RNN) layers to use (`gru` or `lstm`), and then select the unit size of the layer. Options are `gru` and `lstm`. Layer 2 is optional. If needed, select the RNN and unit.
10. Click **Save & Run** to save and execute training for the model. To exit without saving and running the model, click **Cancel**.

## Create a new deployment

To deploy a custom model, navigate to the megamenu and click **Models > Custom Models**.

1. In the Custom Models screen, click the model you want to deploy, and then click **Deployment Details > + New Deployment**.
2. Complete the following fields:

   * Enter a unique value to describe the deployment in the **Name** field.
   * Click and drag the scale to set the number of **Minimum Replicas** for the model. The maximum value is **12**.
   * Click and drag the scale to set the number of **Maximum Replicas** for the model. The maximum number is **12**.
   * Select the **Region** where the model is to be deployed.

     <Note>  These fields cannot be changed after the model is deployed. If you need different values, you must create another deployment with the new information.</Note>
3. Click **Save & Run** to deploy the model. To exit without saving the information and deploying the model, click **Cancel**. The deployment displays on the Deployment Details screen for the model.
