---
title: "Cerebras"
description: "Lightning-fast inference powered by the world's largest AI chip. Run Llama 3.1 models at over 2000 tokens per second for instant code assistance."
seo:
  title: "Cerebras Integration"
  description: "Lightning-fast inference with Cerebras AI. Run Llama models at over 2000 tokens per second with Cerebras cloud infrastructure."
---

## What is the Autohand Cerebras integration? [#quick-answer]

The Autohand Cerebras integration connects the CLI to Cerebras through its OpenAI-compatible inference API. It supports API-key authentication and model selection through the standard Autohand provider and model configuration.

|  |  |
| --- | --- |
| Status | Available |
| Requires | A Cerebras API key and a model available to that Cerebras account. |
| Configure with | Put your key in `cerebras.apiKey` in `~/.autohand/config.json` (the CLI does not read `CEREBRAS_API_KEY`), select the `cerebras` provider, and choose a model ID available in the Cerebras catalog. |
| Best for | Hosted inference through a Cerebras account. |

:::warning
**Know before you start:** Available model IDs, limits, and performance depend on the current Cerebras account and service catalog.
:::

## Overview

Cerebras Inference delivers the fastest AI inference available through their custom Wafer-Scale Engine chips. When integrated with Autohand, you get:

- Inference speeds over 2000 tokens per second
- Near-instant responses for code completion
- Access to Llama 3.1 8B and 70B models
- OpenAI-compatible API for easy integration
- Competitive pricing for high-speed inference

:::tip
**Speed advantage:** Cerebras inference is 10-20x faster than typical cloud providers. This makes it ideal for interactive coding sessions where latency matters.
:::

## Setup

Get started with Cerebras inference.

### Get your API key

1. Go to [cloud.cerebras.ai](https://cloud.cerebras.ai) and create an account
2. Navigate to **API Keys** in your dashboard
3. Create a new API key and copy it

### Configure Autohand

```bash
# Save the key in ~/.autohand/config.json
autohand config set cerebras.apiKey "csk-xxxxxxxxxxxxxxxxxxxx"
```

Verify your configuration:

```bash
# Start with Cerebras provider
autohand --provider cerebras --model llama3.1-70b

# Test with a prompt
autohand --prompt "Hello, which model are you?"
```

## CLI configuration

Configure Cerebras in your `~/.autohand/config.json`:

```json
{
  "provider": "cerebras",
  "cerebras": {
    "apiKey": "csk-xxxxxxxxxxxxxxxxxxxx",
    "model": "llama3.1-70b"
  }
}
```

### Configuration options

| Option | Description | Default |
| --- | --- | --- |
| `apiKey` | Your Cerebras API key | \- |
| `model` | Model to use | `llama3.1-70b` |
| `baseUrl` | API endpoint | `https://api.cerebras.ai/v1` |

## Available models [#models]

Cerebras offers optimized Llama models on their infrastructure.

| Model | Context | Speed | Best for |
| --- | --- | --- | --- |
| `llama3.1-8b` | 128K | 2100+ tok/s | Fast tasks, simple queries |
| `llama3.1-70b` | 128K | 2000+ tok/s | Complex reasoning, coding |

### Switch models

```bash
# Set default model
autohand config set cerebras.model "llama3.1-70b"

# Use a model for one run
autohand --model "llama3.1-8b"

# During a session, open the model picker
/model
```

## Best practices

- **Use for interactive work**: Cerebras excels at interactive sessions where response time matters.
- **Choose 70B for coding**: The larger model handles complex code better.
- **Use 8B for simple tasks**: Quick questions and simple completions.
- **Monitor usage**: Check your Cerebras dashboard for usage and costs.

### Recommended configuration

```json
{
  "cerebras": {
    "model": "llama3.1-70b"
  }
}
```

## Resources

- [Cerebras Website](https://cerebras.ai)
- [API Documentation](https://inference-docs.cerebras.ai)
- [Cloud Console](https://cloud.cerebras.ai)
- [API Reference](https://inference-docs.cerebras.ai/api-reference)
- [Inference Pricing](https://cerebras.ai/inference)

## Troubleshooting

### Common issues

| Issue | Solution |
| --- | --- |
| Invalid API key | Verify key at [cloud.cerebras.ai](https://cloud.cerebras.ai) |
| Rate limited | Wait or upgrade your plan |
| Connection timeout | Check your network or try again |

### Debug mode

```bash
# Enable verbose logging
AUTOHAND_DEBUG=true autohand --provider cerebras
```

**How do I configure the Autohand Cerebras integration?**

Put your key in `cerebras.apiKey` in `~/.autohand/config.json` (the CLI does not read `CEREBRAS_API_KEY`), select the `cerebras` provider, and choose a model ID available in the Cerebras catalog.

**What does the Autohand Cerebras integration require?**

A Cerebras API key and a model available to that Cerebras account.

**What limitations should I know about?**

Available model IDs, limits, and performance depend on the current Cerebras account and service catalog.
