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

# Factory

Install Factory's Droid CLI and connect it to GMI Cloud in under 5 minutes.

Droid is Factory's agent-native coding agent that runs in your terminal. Connect it to GMI Cloud and any model in the GMI catalog becomes available for reading files, reasoning about code, and making edits, directly from the CLI.

## Prerequisites

* A Mac, Linux, or Windows machine with a terminal
* A GMI Cloud account at [console.gmicloud.ai](http://console.gmicloud.ai)
* About 5 minutes

## Step 1. Install Droid

Run this command in your terminal:

```bash theme={null}
curl -fsSL https://app.factory.ai/cli | sh
```

The installer prints a line to add Droid to your `PATH`. Append it to your shell config and reload:

```bash theme={null}
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

*Tip: Use* `~/.zshrc `*instead of* `~/.bashrc `*if you're on zsh. On Linux, also install* `xdg-utils sudo apt-get install xdg-utils`*) so the browser sign-in works.*

Verify the install worked:

```bash theme={null}
droid --version
```

## Step 2. Sign in and choose BYOK

Launch Droid for the first time:

```bash theme={null}
droid
```

A browser opens for onboarding. Sign in, select your organization, then choose how you'll get models. Select **Use Your Own API Keys**, the BYOK path that lets Droid run on your GMI Cloud key.

When you see the confirmation that the CLI is installed, close the tab and return to your terminal.

*Note: Signing in authenticates you to Factory. Your GMI Cloud key, configured next, is what actually runs inference. Choosing the managed plan instead routes requests through Factory's own models, not GMI.*

## Step 3. Connect GMI Cloud

Store your GMI Cloud key as an environment variable so it stays out of the config file:

```bash theme={null}
echo 'export GMI_API_KEY="your-gmi-key-here"' >> ~/.bashrc
source ~/.bashrc
```

Get your key from [console.gmicloud.ai](http://console.gmicloud.ai): open **API Keys**, create a key, and copy it.

Then add GMI Cloud to Droid's config at `~/.factory/settings.json`:

```bash theme={null}
mkdir -p ~/.factory
cat > ~/.factory/settings.json << 'EOF'
{
  "customModels": [
    {
      "model": "zai-org/GLM-5.2-FP8",
      "displayName": "GLM-5.2 (GMI Cloud)",
      "baseUrl": "https://api.gmi-serving.com/v1",
      "apiKey": "${GMI_API_KEY}",
      "provider": "generic-chat-completion-api",
      "maxOutputTokens": 16384
    }
  ]
}
EOF
```

Set `model` to the exact model ID from the Text catalog. The example uses GLM-5.2; swap in any model from the table in Step 4. Add more entries to the `customModels` array to keep several models on hand.

*Note:* `baseUrl `*is always* `https://api.gmi-serving.com/v1`*, and* `provider `*is* `generic-chat-completion-api `*because GMI Cloud is OpenAI-compatible. If* `~/.factory/settings.json `*already has settings, add the* `customModels `*key alongside them instead of overwriting the file.*

GMI Cloud is now connected.

## Step 4. Pick a model

Start Droid in any project:

```bash theme={null}
cd your-project
droid
```

Type:

```text theme={null}
/model
```

The model picker opens. Your GMI Cloud models appear in the **Custom models** section at the bottom of the list, below Factory's built-in models. Select your GMI model and press **Enter**.

Recommended models for coding:

| Model                | Best for                          |
| :------------------- | :-------------------------------- |
| Qwen3-Coder-480B     | Best coding quality               |
| DeepSeek V4 Pro      | Complex reasoning & hard problems |
| Claude Sonnet 4.6    | Balanced quality + speed          |
| Claude Opus 4.7 Fast | Fast, high-quality responses      |
| DeepSeek V4 Flash    | Lightweight, quick tasks          |

*Tip: Factory recommends models with at least 30B parameters for agentic coding. Smaller models work for experimentation but struggle with multi-step engineering tasks.*

## Step 5. Start coding

You're all set. Type any task in the prompt and hit **Enter**:

```text theme={null}
Fix the broken tests in this project
```

```text theme={null}
Explain what this codebase does
```

```text theme={null}
Refactor this function to be more readable
```

Droid reads your files, reasons about the code, and makes changes directly.

## Useful commands

| Command   | What it does                             |
| :-------- | :--------------------------------------- |
| `/model`  | Switch the active model                  |
| `/limits` | Manage plan and usage preferences        |
| `/auto`   | Set how much Droid can do without asking |

*Note: Seeing **"No active subscription found"** on startup? That's expected with BYOK. Droid opens on a Factory-managed model that needs a paid plan. Select your GMI model from the Custom models section at the bottom of* `/model `*and the warning no longer applies to your session.*

## Next steps

* Try Claude Code, Codex, or Cursor with the same GMI account.
* Factory docs: [docs.factory.ai](http://docs.factory.ai)
