# Self-Hosted Models

## What Are Self-Hosted Models?

Self-hosted models let you run any OpenAI-API-compatible checkpoint on your own hardware (or cloud) and plug it directly into MindStudio. This is ideal if you:

* Are a hobbyist experimenting with cutting-edge open-source models (e.g., Llama 3.2).
* Work at an organization that needs private, fine-tuned, or on-premise models.&#x20;

***

## How to Connect a Self-Hosted Model in MindStudio

#### **Prepare Your Model Endpoint**

* Run your model locally or on a server in an OpenAI-compatible way (for example, serving Llama 3.2 via `ncro`).&#x20;

#### **Open the Self-Hosted Models Panel**

* In your MindStudio workspace, click **Self-Hosted Models** in the sidebar.&#x20;

#### **Add a New Model**

* Click **Add New Model**.
* **Name**: Enter a friendly label (e.g., “Llama 3.2”).
* **API Name**: Choose an identifier you’ll use in blocks.
* **API Endpoint URL**: Paste the URL where your model is served (e.g., `http://localhost:8000/v1`).
* Leave all other settings at their defaults and click **Save**.&#x20;

#### **Use Your Self-Hosted Model in an Agent**

1. Create or open an existing agent.
2. Add a **Generate Text** block (or any block that uses a model).
3. In the block’s settings, switch to the **Self-Hosted** category and select your model (“Llama 3.2”).
4. Enter your prompt (e.g., “What is your name?”) and run.
5. Watch MindStudio route the request to your endpoint and return the result in the chat.&#x20;

***

### Compatibility & Notes

* **Any API-compatible service** works—open-source forks, private enterprise models, or on-premise deployments.
* **No extra setup** in your prompts or blocks; MindStudio handles routing transparently.
* **Visible requests**: You can observe incoming requests in your model logs to verify connectivity.


---

# 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://university.mindstudio.ai/docs/developers/self-hosted-models.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.
