> For the complete documentation index, see [llms.txt](https://university.mindstudio.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://university.mindstudio.ai/developers/self-hosted-models.md).

# Self-Hosted Models

Connect and manage self hosted models to your AI agents.

## 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://university.mindstudio.ai/developers/self-hosted-models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
