# Chasm Inference Scout Setup Guide

Introduction

Welcome to the Inference Scout documentation. This guide will help you set up and run Inference Scout on your server, whether you are a first-time user or a seasoned developer.

Inference Scout is a tool that runs inference tasks given by Chasm's Orchestrator. It allows you to leverage powerful language models and contribute to Chasm Network.

## Prerequisites

#### API Keys

* Obtain a Groq API key from the [Groq Console](https://console.groq.com/keys)
* (Optional) Obtain an Openrouter API key from Openrouter
* Obtain `SCOUT_UID` and `WEBHOOK_API_KEY` from the Chasm Website

#### Server Specifications

Minimum Requirements:

* 1 vCPU
* 1GB RAM
* 20GB Disk
* Static IP

Suggested Requirements:

* 2 vCPU
* 4GB RAM
* 50GB SSD
* Static IP

### Obtaining your SCOUT\_UID and WEBHOOK\_API\_KEY

1. Go to <https://scout.chasm.net/private-mint>

   <figure><img src="https://3640688233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoDYYIBTYFerp1E0aQIKD%2Fuploads%2F1pyRV5zLgOqCAyDiN58C%2Fimage.png?alt=media&#x26;token=bc8e1226-eac1-44a5-8aa7-709ad59660ae" alt=""><figcaption></figcaption></figure>
2. Click `_mint(scout)`
3. Log in to the website and retrieve your webhook API key and UID as the first step.

<figure><img src="https://3640688233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoDYYIBTYFerp1E0aQIKD%2Fuploads%2FQqGS4KeIK48vHb53Hduj%2Fimage.png?alt=media&#x26;token=3b2c679f-e5db-419e-8536-de45055d487c" alt=""><figcaption></figcaption></figure>

## Software Requirements

1. Install Docker: Follow the [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)
2. Make a new folder and enter the folder: Do a `mkdir chasm-scout`and `cd chasm-scout`
3. Set up the environment file: Use `nano .env` or `vim .env` to create a file with the following content:

```
PORT=3001
LOGGER_LEVEL=debug

# Chasm
ORCHESTRATOR_URL=https://orchestrator.chasm.net
SCOUT_NAME=
SCOUT_UID=
WEBHOOK_API_KEY=
# Scout Webhook Url, update based on your server's IP and Port
# e.g. http://123.123.123.123:3001/
WEBHOOK_URL=

# Chosen Provider (groq, openai)
PROVIDERS=groq
MODEL=gemma2-9b-it
GROQ_API_KEY=

# Optional
OPENROUTER_API_KEY=
OPENAI_API_KEY=
```

{% hint style="info" %}
Do not use single quotes (') or double quotes (") in your .env file, as Docker has issues with them.
{% endhint %}

### Setup Guide

1. Get Required Credentials from Chasm
2. Prepare the `.env` File (as shown above)
3. Pull the Docker Image:

   ```bash
   docker pull chasmtech/chasm-scout:latest
   ```
4. Run the Docker Container:

   ```bash
   docker run -d --restart=always --env-file ./.env -p 3001:3001 --name scout chasmtech/chasm-scout
   ```
5. Verify Server Status:

   ```bash
   docker logs scout
   ```
6. Test Server Response:

   ```bash
   curl localhost:3001
   ```

   Expected response: `OK`
7. Test LLM Functionality:

   ```bash
   source ./.env
   curl -X POST \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $WEBHOOK_API_KEY" \
        -d '{"body":"{\"model\":\"gemma2-9b-it\",\"messages\":[{\"role\":\"system\",\"content\":\"You are a helpful assistant.\"}]}"}' \
        $WEBHOOK_URL
   ```
8. Restart Docker Container (if needed):

   ```bash
   docker stop scout
   docker rm scout
   docker run -d --restart=always --env-file ./.env -p 3001:3001 --name scout johnsonchasm/chasm-scout
   ```
9. Verify Scout Ranking:&#x20;

   Check your scout ranking at the [Leaderboard](https://scout.chasm.net/leaderboard). Note: The node status may take up to an hour to update.
10. Monitor Scout Performance:

    ```bash
    docker stats scout
    ```

### Troubleshooting

#### Environment Variables

Double-check that all required environment variables are correctly set in the `.env` file.

#### Additional Resources

* **Optimization Guide:** Follow the [optimization guide](https://network-docs.chasm.net/chasm-scout-season-0/competitive-scout-optimization) for performance improvements.
* **Update Guide:** Follow the [update guide](https://network-docs.chasm.net/chasm-scout-season-0/updating-inference-scouts) for updating your scout.

This guide should help you set up and run the Chasm Scout server effectively. For more detailed instructions and troubleshooting, refer to the original repository and additional resources provided.
