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

# Connect with Oh My Pi

> Set up Oh My Pi (omp) to use Modular Cloud models

This page explains how to run models from Modular Cloud on
[Oh My Pi](https://omp.sh/) (`omp`), a coding agent built on
[Pi](https://docs.modular.com/coding-assistants/pi.md).

## Before you begin

Make sure you have:

* A Modular Cloud [API key](https://docs.modular.com/administration/api-keys.md).
* [Oh My Pi](https://omp.sh/docs/quickstart) 18.15.0 or later installed.

## Connect to the Modular provider

Modular is a built-in provider in Oh My Pi, so you can connect a model from
any of our shared endpoints with only an API key.

1. Start Oh My Pi:

   ```bash theme={null}
   omp
   ```

2. Run the `/login modular` command and paste your API key. You can skip this
   step if you set the `MODULAR_API_KEY` environment variable before you start
   Oh My Pi.

3. Run the `/model` command and choose a Modular Cloud model.

The Oh My Pi model list only includes models on Modular Cloud shared
endpoints. The next section describes how to connect a model from a dedicated
deployment.

## Connect a dedicated deployment

Each dedicated deployment runs on your organization's own endpoint, so you need
to add it to Oh My Pi as a custom provider:

1. Open your [deployment](https://console.modular.com/deployments) and copy
   its **Dedicated Endpoint** and **Model ID**.

2. Export your API key as an environment variable:

   ```bash macOS/Linux theme={null}
   export MODULAR_API_KEY="YOUR_API_KEY"
   ```

   ```powershell Windows theme={null}
   $env:MODULAR_API_KEY="YOUR_API_KEY"
   ```

3. Open (or create) the `~/.omp/agent/models.yml` config file and add a
   provider for your deployment:

   ```yaml models.yml theme={null}
   providers:
     modular-dedicated:
       baseUrl: https://YOUR_ORG_NAME.api.modular.com/v1
       api: openai-completions
       apiKey: MODULAR_API_KEY
       models:
         - id: moonshotai/Kimi-K2.7-Code
           name: Kimi K2.7 Code
   ```

   In `baseUrl`, paste the dedicated endpoint you copied in step 1 with `/v1`
   appended. Then replace the model ID with your deployment's model ID.
   Modular Cloud supports the OpenAI [chat completions
   API](https://docs.modular.com/api/inference/create-chat-completion.md), so set `api` to
   `openai-completions`.

   Avoid naming the provider `modular`. That ID belongs to the built-in
   Modular provider, so your settings would override it instead of adding a
   separate provider.

4. Start Oh My Pi, run the `/model` command, and select your deployment's model.

To see the complete list of configuration options for custom providers, see
the Oh My Pi documentation on
[custom models and providers](https://omp.sh/docs/custom-models).
