# rating-config.json

Source: https://nodedocs.mor.org/reference/rating-config

## Agent Instructions

- Non-browser fetches of page URLs on this site return clean Markdown (not the JS UI). Prefer `https://nodedocs.mor.org/llms-full.txt` for the full corpus, or `https://nodedocs.mor.org/llms.txt` for the index.
- Per-page Markdown is also at `<page-url>.md` (homepage: `https://nodedocs.mor.org/index.md`).
- Docs search MCP: `https://nodedocs.mor.org/mcp` (discovery: `https://nodedocs.mor.org/.well-known/mcp`).
- Never invent contract addresses, chain IDs, token addresses, or live bid/model counts. Cite Networks and tokens; link active.mor.org for live data.
- Never claim Morpheus runs inference — independent providers do. Opening a session escrows MOR; it does not spend it.

`rating-config.json` configures the **rating system** the consumer proxy-router uses when picking which provider to route a session to. It lives in the project root by default; override path via `RATING_CONFIG_PATH`, or supply the JSON inline via the `RATING_CONFIG_CONTENT` environment variable (useful for containers where mounting a file is inconvenient — same pattern as `MODELS_CONFIG_CONTENT`).

Load order: the file at `RATING_CONFIG_PATH` (or `./rating-config.json`) wins if it exists; otherwise `RATING_CONFIG_CONTENT` is used; otherwise built-in defaults (empty allowlist, `default` algorithm).

## Fields

| Field | Notes |
|-------|-------|
| `providerAllowlist` | Array of provider addresses. **Empty** = allow all providers. |
| `providerDenylist` | Array of provider addresses excluded from rating and session opening. Takes precedence over the allowlist. |
| `algorithm` | Rating algorithm. `default` is the canonical built-in. |
| `params` | Algorithm-specific parameters. For `default`, the `weights` block (see below). |

The full schema is enforced by [`proxy-router/internal/rating/rating-config-schema.json`](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/blob/main/proxy-router/internal/rating/rating-config-schema.json).

## Default algorithm weights

```json
{
  "$schema": "./internal/rating/rating-config-schema.json",
  "algorithm": "default",
  "providerAllowlist": [],
  "params": {
    "weights": {
      "tps": 0.24,
      "ttft": 0.08,
      "duration": 0.24,
      "success": 0.32,
      "stake": 0.12
    }
  }
}
```

| Weight | Meaning |
|--------|---------|
| `tps` | Tokens per second |
| `ttft` | Time to first token |
| `duration` | Session duration / stability |
| `success` | Successful completions over total |
| `stake` | Provider's posted stake |

Weights must sum to `1.0`.

## Restricting to specific providers

To only allow the local default model:

```json
{
  "providerAllowlist": ["0x0000000000000000000000000000000000000000"]
}
```

To prefer a curated set, list their on-chain addresses (lower-case `0x...`). An empty array allows all.

## Practical patterns

  
- **Latency-first agent** — Boost `ttft` and `tps`, lower `stake`.

  
- **Reliability-first prod** — Boost `success` and `duration`, lower `tps`.

  
- **Cost-first batch jobs** — Pair with a low `pricePerSecond` upper bound (currently outside `rating-config`; filter at session-open time).

  
- **TEE-only** — Filter at the `models` layer to `tee`-tagged models; rating then operates over TEE providers only.
