# Upload custom model

To upload a custom model to RagaAI Prism, follow these steps:

```python
from raga import *
import datetime

# Generate a unique run name
run_name = "run_name"

# Initialize a test session
test_session = TestSession(
    project_name="project_name",
    run_name=run_name,
    access_key="",  # Add your access key
    secret_key="",  # Add your secret key
    host="host_name"
)

# Define infrastructure parameters
infra_params = {
    "minReplicas": "1",
    "maxReplicas": "1",
    "workGroup": "cpu",
    "maxMemoryLimit": "3000Mi",
    "maxCpuLimit": "3000m",
    "minMemoryLimit": "3000Mi",
    "minCpuLimit": "3000m",
}

# Define input and output functions
def input_function():
    return ""

def output_function():
    return ""

# Create and load the model
model = Model(
    test_session=test_session,
    name="model-name",
    version="v1",
    description="model-description",
    docker_image="model-image",
    infra_params=infra_params,
    config_params={},
    input_func=input_function,
    output_func=output_function
)

model.load()
```

This script sets up and uploads a custom model using the RagaAI Prism platform, allowing you to specify model details, infrastructure, and I/O functions.

{% hint style="info" %}
**Note:** Currently, model upload requires the model code to be present and built locally. An upcoming feature will allow you to upload a model directly using a Docker Hub path.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raga.ai/ragaai-prism/upload-custom-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
