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

> ## Agent Instructions
> For autonomous tasks, use live SaladCloud API responses for current state, availability, quotas, models, and other dynamic values. Use current OpenAPI specifications where provided for paths, schemas, required fields, and enums. Never invent endpoints, fields, prices, availability, quotas, models, or state. Prefer API workflows over Portal steps. Read before changing and never expose credentials, signed media URLs, prompts, or sensitive outputs. Retry only safe or idempotent operations with bounded backoff, honoring Retry-After. Verify every write with a read. Stop rather than repeat an uncertain non-idempotent or billable request. AI Gateway uses an organization-specific Bearer key and live /v1/models discovery. Do not delete, cancel, stop, or reduce capacity without explicit user intent. Bind shared operation IDs to the selected product path. Treat Container Engine instances as interruptible and local state as ephemeral. Install the SaladCloud skills (npx skills add https://docs.salad.com), start from the salad skill and /agents/overview; docs MCP: https://docs.salad.com/mcp.

# Use Aider with SaladCloud

> Learn how to use the Aider AI coding agent from the command line with a self-hosted model on SaladCloud.

*Last Updated: October 12, 2026*

## Introduction

[Aider](https://aider.chat) is an open-source AI pair programmer that runs in your terminal. It integrates with your
local git repository, can create and edit files across multiple languages, and commits changes automatically as you
work. Aider is designed from the ground up to support OpenAI-compatible endpoints, making it one of the simplest tools
to connect to a model on SaladCloud.

Aider works with SaladCloud in two ways:

* **[Salad AI Gateway](https://docs.salad.com/ai-gateway/explanation/overview.md)** - no infrastructure to deploy or manage. Available in beta
  with [pay-per-token billing](https://docs.salad.com/ai-gateway/reference/pricing.md). Connect to the shared endpoint using your
  organization-specific AI Gateway API key.
* **Self-hosted model** - deploy your own SaladCloud container group, billed per hour, for full control over the model,
  hardware, and configuration. Still very easy to set up and use.

## Prerequisites

Before getting started, make sure you have:

* A [SaladCloud account](https://portal.salad.com)
* Python 3.8+ installed
* A local git repository to work in

## Step-by-Step Setup

### Step 1: Choose Your Backend

> [tab] Salad AI Gateway
>
> Salad AI Gateway is the fastest way to get started - no container groups to deploy, no cold starts to wait for.
>
> 1. Sign in to the [SaladCloud portal](https://portal.salad.com).
> 2. Follow [Pay-Per-Token Onboarding](https://docs.salad.com/ai-gateway/tutorials/pay-per-token-onboarding.md) to add credits and create your
>    organization's **AI Gateway API key**.
>
> Available models:
>
> | Model | Description |
> | :- | :- |
> | `qwen3.6-35b-a3b` | Qwen 3.6 35B-A3B - best for agentic tasks, coding, and complex reasoning |
> | `qwen3.6-27b` | Qwen 3.6 27B - general purpose, balancing capability and speed |
> | `qwen3.5-35b-a3b` | Qwen 3.5 35B-A3B - cost-efficient agentic tasks and reasoning |
> | `qwen3.5-9b` | Qwen 3.5 9B - fastest model, for high-volume simple queries |

> [tab] Self-Hosted on SaladCloud
>
> First, deploy an OpenAI-compatible LLM server on SaladCloud.
>
> * Go to the [SaladCloud portal](https://portal.salad.com) and create an account if you do not already have one.
> * Create an organization or choose an existing one, then click "Deploy a container group".
> * Select an LLM recipe. The best fit for agentic coding is the Qwen3.6-35B-A3B (llama.cpp) recipe. On the recipe
>   page, provide a name and deploy — the rest is preconfigured with recommended settings.
> * Once deployed, your endpoint will be live and serving an OpenAI-compatible API.
>
> Available recipes:
>
> Ready-to-deploy recipes (best for less technical users):
>
> * [qwen3.6-35B-A3B](https://docs.salad.com/container-engine/reference/recipes/qwen3.6-35b-a3b-llama-cpp.md) — A powerful Mixture of Experts
>   model optimized for instruction-following tasks, ideal for agentic use cases.
> * [qwen3.5-9b-llama-cpp](https://docs.salad.com/container-engine/reference/recipes/qwen3.5-9b-llama-cpp.md) — Optimized for Qwen3.5 9B model.
>
> Recipes for custom deployments (best for advanced users):
>
> * [llama.cpp](https://docs.salad.com/container-engine/reference/recipes/llama-cpp.md) — Supports GGUF models
> * [sglang](https://docs.salad.com/container-engine/reference/recipes/sglang.md) — High-performance inference
> * [vllm](https://docs.salad.com/container-engine/reference/recipes/vllm.md) — Popular LLM serving framework
> * [ollama](https://docs.salad.com/container-engine/reference/recipes/ollama.md) — Simple model management
> * [tgi](https://docs.salad.com/container-engine/reference/recipes/tgi.md) — Hugging Face Text Generation Inference server
>
> After deployment, note your:
>
> * **API endpoint URL** (e.g., `https://your-endpoint.salad.cloud`)

### Step 2: Install Aider on your local machine

Install Aider via pip:

```bash theme={null}
pip install aider-chat
```

Verify the installation:

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

### Step 3: Configure Aider to Use Your SaladCloud Endpoint

> [tab] Salad AI Gateway
>
> Set the required environment variables before running Aider:
>
> ```bash theme={null}
> export OPENAI_API_BASE=https://ai.salad.cloud/v1
> export OPENAI_API_KEY=your-ai-gateway-api-key
> ```
>
> Use your organization-specific AI Gateway key in `OPENAI_API_KEY`, not your account API key. No custom headers
> are needed.

> [tab] Self-Hosted on SaladCloud
>
> Set the required environment variables before running Aider:
>
> ```bash theme={null}
> export OPENAI_API_BASE=https://your-endpoint.salad.cloud/v1
> export OPENAI_API_KEY=dummy
> ```
>
> `OPENAI_API_KEY` is required, but can be set to any non-empty string (e.g., `dummy`).
>
> Alternatively, create a `.aider.conf.yml` file in your project root to persist the configuration:
>
> ```yaml theme={null}
> model: openai/qwen3.6-35b-a3b
> openai-api-base: https://your-endpoint.salad.cloud/
> openai-api-key: your-salad-api-key
> ```
>
> If your SaladCloud deployment requires authentication, create .aider.model.settings.yml file and add the following
> header configuration:
>
> ```yaml theme={null}
> - name: openai/qwen3.6-35b-a3b
>   extra_params:
>     extra_headers:
>       Salad-Api-Key: your-salad-api-key
> ```

### Step 4: Start Aider and Test the Connection

Navigate to your project directory and start Aider, prefixing the model name with `openai/`:

```bash theme={null}
cd /path/to/your/project
aider --model openai/qwen3.6-35b-a3b
```

The openai/ prefix is important — it tells Aider to route through the OpenAI-compatible provider.

Test with a simple task:

> "Create a hello world Python script that prints 'Hello from SaladCloud!'"

If Aider successfully creates and commits the file, your setup is complete.

**Note:** Aider may display a warning about an unknown model. This is safe to ignore — Aider is simply checking its
internal model database and your SaladCloud model won't be listed there.

## Tips for Best Results

### Use the `--edit-format` Flag

For smaller or less capable models, the `whole` edit format is more reliable than the default `diff` format:

```bash theme={null}
aider --model openai/qwen3.6-35b-a3b --edit-format whole
```

The `diff` format produces more efficient edits but requires the model to generate valid unified diffs, which some
models struggle with.

### Work in a Git Repository

Aider is designed to work inside a git repository. It automatically commits each change it makes, giving you a full undo
history. Initialize git in your project if you haven't already:

```bash theme={null}
git init
```

### Set a Context Window

When using a custom deployment, set the context window to the maximum value your model can use so Aider can send as much
repository context as possible. For the Qwen models listed on the
[AI Gateway models page](https://docs.salad.com/ai-gateway/reference/models.md), the maximum depends on the model, up to **262,144 tokens**.

### Model Recommendations

* **Qwen 3.6-35B-A3B**: Best balance of capability and cost for agentic coding tasks
* **Qwen 3.5-9B**: Suitable for simpler tasks; may struggle with complex multi-file edits

This documentation page was created using Aider powered by an LLM model running on SaladCloud.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.