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

# Custom API Endpoints and Self-Hosted Models in Luminy

> Connect Luminy to any OpenAI-compatible or Anthropic-compatible API endpoint, including self-hosted models, LM Studio, and private deployments.

Luminy is not limited to the built-in provider list — you can point it at any server that speaks the OpenAI Chat Completions API or the Anthropic Messages API. This means LM Studio, vLLM, llama.cpp with an HTTP server, Azure OpenAI, corporate API gateways, and any other compatible endpoint all work out of the box.

## Endpoint types

<Tabs>
  <Tab title="OpenAI-compatible">
    Use the `openai-compat` provider for any server that implements the OpenAI Chat Completions API (`POST /v1/chat/completions`).

    **Model ID prefix:** `openai-compat:`

    **Example model ID:**

    ```text theme={null}
    openai-compat:my-model-name
    ```

    **Common compatible servers:**

    | Server               | Default base URL                                                      | Notes                                           |
    | -------------------- | --------------------------------------------------------------------- | ----------------------------------------------- |
    | LM Studio            | `http://localhost:1234/v1`                                            | Enable the local server in LM Studio's settings |
    | vLLM                 | `http://localhost:8000/v1`                                            | Specify `--served-model-name` when launching    |
    | Ollama (OpenAI mode) | `http://localhost:11434/v1`                                           | Alternative to the native Ollama integration    |
    | Azure OpenAI         | `https://<resource>.openai.azure.com/openai/deployments/<deployment>` | Requires deployment name as model               |
    | llama.cpp server     | `http://localhost:8080/v1`                                            | Start with `--port 8080`                        |
  </Tab>

  <Tab title="Anthropic-compatible">
    Use the `anthropic-compat` provider for any server that implements the Anthropic Messages API (`POST /v1/messages`).

    **Model ID prefix:** `anthropic-compat:`

    **Example model ID:**

    ```text theme={null}
    anthropic-compat:my-model-name
    ```

    This is useful for self-hosted proxies, enterprise gateways, or research servers that expose the Anthropic-style request/response format.
  </Tab>
</Tabs>

## Configuring a custom endpoint

<Steps>
  <Step title="Open Settings">
    Click the gear icon or press <kbd>⌘,</kbd> (macOS) / <kbd>Ctrl+,</kbd> (Windows/Linux).
  </Step>

  <Step title="Navigate to the custom endpoint section">
    Scroll to **Custom Endpoints** (or the specific provider section — **OpenAI-Compatible** or **Anthropic-Compatible**).
  </Step>

  <Step title="Enter the base URL">
    Paste your server's base URL, for example:

    ```text theme={null}
    http://localhost:1234/v1
    ```

    Do **not** include the specific path (e.g., `/chat/completions`) — Luminy appends the correct path automatically.
  </Step>

  <Step title="Enter the model name">
    Type the model name exactly as your server expects it, for example:

    ```text theme={null}
    llama-3.1-8b-instruct
    ```

    This becomes the model ID after the prefix: `openai-compat:llama-3.1-8b-instruct`.
  </Step>

  <Step title="Enter an API key (if required)">
    Some servers require a bearer token or API key. Paste it into the **API Key** field. If your server has no authentication, you can leave this blank or enter any placeholder string — the field is optional.
  </Step>

  <Step title="Save and select your model">
    Click **Save**. The custom model appears in the chat composer's model selector. Select it and start a session.
  </Step>
</Steps>

## Example: LM Studio

[LM Studio](https://lmstudio.ai) runs a local OpenAI-compatible server on your machine.

<Steps>
  <Step title="Enable the LM Studio server">
    Open LM Studio, load a model, go to the **Local Server** tab, and click **Start Server**. It listens on `http://localhost:1234` by default.
  </Step>

  <Step title="Configure in Luminy">
    In **Settings → OpenAI-Compatible**, set:

    * **Base URL:** `http://localhost:1234/v1`
    * **Model:** the exact model name shown in LM Studio (e.g., `Meta-Llama-3.1-8B-Instruct-Q4_K_M`)
    * **API Key:** leave blank or enter any value
  </Step>

  <Step title="Select the model">
    Choose `openai-compat:Meta-Llama-3.1-8B-Instruct-Q4_K_M` (or your model name) from the selector in the chat composer.
  </Step>
</Steps>

## Use cases

<CardGroup cols={2}>
  <Card title="LM Studio" icon="desktop">
    Run quantized GGUF models locally with a polished UI. Connect Luminy via the built-in OpenAI-compatible server.
  </Card>

  <Card title="Private vLLM deployments" icon="server">
    Deploy vLLM on a GPU server and expose it behind a private URL. Configure the base URL and optional bearer token in Luminy.
  </Card>

  <Card title="Azure OpenAI" icon="microsoft">
    Use your Azure OpenAI deployment endpoint and API key. Enter the full deployment URL as the base URL.
  </Card>

  <Card title="Corporate API gateways" icon="building">
    Many enterprises proxy AI APIs through internal gateways. If the gateway is OpenAI-compatible, Luminy connects directly.
  </Card>
</CardGroup>

## Tool calling requirement

<Warning>
  Luminy's agentic loop — file edits, terminal commands, multi-step task execution — depends on the model's tool/function calling capability. Not every model or server supports it.

  Before using a custom endpoint for agentic tasks, verify that:

  * The **model** you are serving supports tool/function calling.
  * The **server** correctly implements the `tools` parameter in the Chat Completions or Messages API.

  If tool calling is unsupported, Luminy falls back to text-only responses and the agentic features will be unavailable for that model.
</Warning>
