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

# Isolated testing

> Run Radium alongside your existing provider without touching existing config

# Isolated testing

You don't have to migrate everything at once. Run Radium in parallel with your current provider to compare output quality, latency and cost before changing production code.

## Goal

Send 5-10% of your traffic to Radium while the rest stays on your existing provider. No code changes to existing services required.

## Prerequisites

* A Radium API key from the [dashboard](https://deploy.radium.cloud)
* Your current provider still working as-is

## Strategy 1: Environment-variable switching

The quickest way to test is route by changing which key your code reads.

```bash theme={null}
# Existing setup
export OPENAI_API_KEY="sk-..."

# Test run — swap the base URL and key, keep everything else identical
export RADIUM_API_KEY="YOUR_RADIUM_API_KEY"
export BASE_URL="https://api.radium.cloud/v1"
```

In your code, read the base URL from env:

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["RADIUM_API_KEY"],
    base_url=os.environ.get("BASE_URL", "https://api.openai.com/v1"),
)
```

```typescript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.RADIUM_API_KEY,
  baseURL: process.env.BASE_URL || "https://api.openai.com/v1",
});
```

## Strategy 2: IDE profiles (Cursor, Cline, Continue)

Most coding agents support multiple provider profiles. Create a "Radium test" profile so you can switch without overwriting your main setup.

### Cursor

1. Open **Settings → Models**
2. Add a custom OpenAI-compatible provider:
   * **Base URL:** `https://api.radium.cloud/v1`
   * **API Key:** your Radium key
   * **Model:** `hal-1.0`
3. Save as profile "Radium" and switch between OpenAI and Radium via the model dropdown

### Cline

Edit `.clinerules` or Cline settings to add Radium as a secondary provider without removing your primary:

```json theme={null}
{
  "providers": [
    { "name": "OpenAI", "baseUrl": "https://api.openai.com/v1", "model": "gpt-4o" },
    { "name": "Radium", "baseUrl": "https://api.radium.cloud/v1", "model": "hal-1.0" }
  ]
}
```

### Continue

Add Radium to your Continue `config.json` alongside existing providers:

```json theme={null}
{
  "models": [
    {
      "title": "GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiKey": "${OPENAI_API_KEY}"
    },
    {
      "title": "Radium Hal",
      "provider": "openai",
      "model": "hal-1.0",
      "apiBase": "https://api.radium.cloud/v1",
      "apiKey": "${RADIUM_API_KEY}"
    }
  ]
}
```

## Strategy 3: Wrapper with fallback

For production services, wrap the client call so it falls back to your existing provider if Radium fails.

```python theme={null}
import os
from openai import OpenAI, APIError

radium = OpenAI(api_key=os.environ["RADIUM_API_KEY"], base_url="https://api.radium.cloud/v1")
openai = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

def chat_with_fallback(model: str, messages: list):
    try:
        radium_model = model.replace("gpt-4o", "hal-1.0")
        return radium.chat.completions.create(model=radium_model, messages=messages)
    except APIError as e:
        print(f"Radium error ({e.status_code}), falling back to OpenAI")
        return openai.chat.completions.create(model=model, messages=messages)
```

## Strategy 4: Feature-flag routing

Use a feature flag (e.g., LaunchDarkly, Unleash, or a simple env var) to control the split:

```python theme={null}
import os

PROVIDER = os.environ.get("AI_PROVIDER", "openai")

if PROVIDER == "radium":
    client = OpenAI(api_key=os.environ["RADIUM_API_KEY"], base_url="https://api.radium.cloud/v1")
    model = "clarke-1.0"
else:
    client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
    model = "gpt-4o"
```

## Validation checklist

Run through this before expanding the test:

* [ ] Responses complete successfully for your top 5 prompt types
* [ ] Tool calls return the same schema as your existing provider
* [ ] Streaming tokens arrive at acceptable speed
* [ ] Cost per request is visible in the Radium dashboard
* [ ] Error rate is below 1% over 100 requests

## Rollback

If anything goes wrong, unset the env var or switch the IDE profile back. No code reverts needed.


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