Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pages/partners/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"comput3": "Comput3",
"chutes": "Chutes",
"libertai": "LibertAI",
"morpheus": "Morpheus"
"morpheus": "Morpheus",
"pearl": "Pearl"
}
145 changes: 145 additions & 0 deletions pages/partners/pearl.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
description: "Pearl for GenLayer validators: API key, authentication, supported models, and GenVM LLM backend setup."
---

# Using Pearl with GenLayer Validators

Pearl is a Layer 1 blockchain secured by Proof-of-Useful-Work: its miners run AI inference, and mining is a by-product of the matrix multiplication that the models need. Pearl serves open-weight models through an OpenAI-compatible API, so GenLayer validators can call them without running their own GPU infrastructure.

This guide explains how GenLayer validators can get a Pearl API key, authenticate requests, and add Pearl as an LLM backend in GenVM.

---

## Why Pearl

Pearl gives validators:

- Open-weight frontier models, served by Pearl's mainnet miners
- An OpenAI-compatible API, which GenVM supports through the `openai-compatible` provider
- Models with JSON output, and models with image input
- Large context windows (about 1M tokens)

---

## Resources

- [Pearl Website](https://pearlresearch.ai)
- API base URL: `https://inference.pearlresearch.ai/v1`

---

## 1. Get an API Key

GenLayer validators can get a Pearl API key from the GenLayer team.

Each key belongs to an organization, and usage is metered against that organization's credits.

---

## 2. Authenticate Requests

The Pearl API uses Bearer token authentication.

Include your API key as a Bearer token in the `Authorization` header. You can verify your key is working by listing the available models:

```bash
curl https://inference.pearlresearch.ai/v1/models \
-H "Authorization: Bearer $PEARL_API_KEY"
```

Requests without a valid key return `401`.

---

## 3. Run Your First Model from a Validator

Pearl provides an OpenAI-compatible inference endpoint for running language models.

**Endpoint:** `https://inference.pearlresearch.ai/v1/chat/completions`

### Example request from a validator environment:

```bash
curl https://inference.pearlresearch.ai/v1/chat/completions \
-H "Authorization: Bearer $PEARL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-ai/DeepSeek-V4.1-Flash-1017",
"messages": [
{
"role": "user",
"content": "Explain decentralized AI infrastructure in one sentence."
}
]
}'
```

The response uses the OpenAI chat completions format. The model output is in `choices[0].message.content`.

---

## 4. Supported Models

These models are available to GenLayer validators:

| Model | JSON output | Image input |
|---|---|---|
| `deepseek-ai/DeepSeek-V4.1-Flash-1017` | Yes | Yes |
| `deepseek-ai/DeepSeek-V4-Pro-0813` | Yes | No |
| `zai-org/GLM-5.3` | Yes | No |
| `zai-org/GLM-5.3-Flash` | Yes | Yes |

To see the models that your key can use, call `/v1/models` as in step 2.

---

## Best Practices

For validator deployments:
- Use a dedicated API key for each validator
- Store the key in environment variables
- Avoid committing API keys to source control

**Example:**

```bash
export PEARL_API_KEY=your_api_key_here
```

This variable is for your own API calls, such as the curl examples above. GenVM does not read it out of the box: Pearl is not a built-in backend in the GenVM LLM configs that ship with the node.

---

## Use Pearl as a GenVM LLM Backend

To let your validator's GenVM send prompts to Pearl, add it as an `openai-compatible` backend in `genvm-module-llm.yaml`, reading the key from the variable above:

```yaml
backends:
pearl:
enabled: true
host: https://inference.pearlresearch.ai # GenVM adds /v1/chat/completions
provider: openai-compatible
key: ${ENV[PEARL_API_KEY]}
models:
deepseek-ai/DeepSeek-V4.1-Flash-1017:
supports_json: true
supports_image: true
deepseek-ai/DeepSeek-V4-Pro-0813:
supports_json: true
supports_image: false
zai-org/GLM-5.3:
supports_json: true
supports_image: false
zai-org/GLM-5.3-Flash:
supports_json: true
supports_image: true
```

Set `host` to `https://inference.pearlresearch.ai`, without `/v1`. GenVM adds `/v1/chat/completions` to the host.

Then:
- Put `PEARL_API_KEY` in the node's environment (with Docker, in `.env`) and restart the node. A running node does not see new environment variables.
- Run `./bin/genlayernode doctor` to check that the backend answers.

See [GenVM Configuration](/validators/genvm-configuration) for the backend format and how the node orders backends.
6 changes: 5 additions & 1 deletion pages/validators/genvm-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ GenVM Configuration defines the LLM providers and web module settings a validato
**[Chutes](/partners/chutes)** — create an account at [chutes.ai](https://chutes.ai) and generate an API key from settings.

**[Morpheus](/partners/morpheus)** — obtain a [Morpheus API key](https://mor.org/) for DeepSeek, Llama, Qwen, and more via OpenAI-compatible API.

**[Pearl](/partners/pearl)** — get a Pearl API key from the GenLayer team for DeepSeek and GLM models via OpenAI-compatible API.
</Callout>

## Hot-Reload
Expand Down Expand Up @@ -96,7 +98,7 @@ The `supports_json` and `supports_image` flags tell the Lua script which models

| Type | Description | Example services |
|---|---|---|
| `openai-compatible` | OpenAI-compatible chat/completions API | OpenAI, OpenRouter, Heurist, Comput3, Chutes, Morpheus, X.ai |
| `openai-compatible` | OpenAI-compatible chat/completions API | OpenAI, OpenRouter, Heurist, Comput3, Chutes, Morpheus, Pearl, X.ai |
| `ollama` | Ollama's native `/api/generate` endpoint | Local Ollama instance |
| `anthropic` | Anthropic's Messages API | Claude models |
| `google` | Google's Generative Language API | Gemini models |
Expand Down Expand Up @@ -169,6 +171,8 @@ Which keys are read depends on the LLM config you run. Two files ship in the Gen

Chutes has no built-in backend. To use it, add an `openai-compatible` backend with your own key variable (see [Chutes](/partners/chutes)).

Pearl has no built-in backend either. To use it, add an `openai-compatible` backend that reads `PEARL_API_KEY` (see [Pearl](/partners/pearl)).

<Callout type="info">
Enabled backends without a configured API key will log warnings. Either set the key or disable the backend with `enabled: false`.
</Callout>
Expand Down