# Sponsor And COHERE Mesh

Sponsor and COHERE let Omnius share inference capacity across peers. Sponsor mode is explicit provider/consumer sharing. COHERE is a distributed cognitive inference mesh.

## Sponsor Provider Flow

```text
/sponsor
```

The wizard covers:

- endpoint selection across all enabled endpoints
- model selection across local and external endpoints
- consumer-visible sponsor label and optional link
- relay/transport settings
- request, token, and concurrency limits
- media sponsorship for image, video, sound, and music

## Sponsor Consumer Flow

```text
/endpoint sponsor
```

Consumers should see sponsor models as endpoint models. They should not need the sponsor's raw upstream URL or provider secret.

## Endpoint Passthrough

Sponsors can expose local models or forward upstream OpenAI-compatible endpoints such as OpenRouter, Groq, Chutes, or vLLM. Model discovery must consolidate models from all toggled enabled endpoints.

## Telemetry

Provider dashboards should report:

- active and maximum concurrency
- requests per minute
- daily tokens
- per-peer token usage
- per-model token usage
- exposed or loaded models
- media jobs by modality

Consumer status rows can alternate local and remote peer metrics so remote Ollama/GPU pressure is visible.

## Media Sponsorship

Providers can expose:

- image generation
- video generation
- sound-effect generation
- music generation

Each modality should enforce provider-side setup, request sanitization, model allowlists, and per-modality limits.

## COHERE

```text
/cohere
/cohere status
/cohere models
/cohere allow <model>
/cohere deny <model>
```

COHERE status should expose daemon health, query counts, error counts, served peers, model exposure, and usage. COHERE endpoint passthrough follows the same rule as sponsor passthrough: do not assume Ollama is the only backend.

## Failure Handling

Directory or peer failures should be surfaced as observed failure output and usage-state signals. Avoid masking broken limits, JSON parse failures, or concurrency override conditions behind generic "unreachable" text.

## Provider Setup Checklist

Before advertising capacity:

- confirm every enabled endpoint has a working model list
- confirm external endpoints return models during wizard step two, not only local Ollama models
- set model and modality allowlists before turning public serving on
- set concurrency, requests-per-minute, daily token, and media job limits
- run `/sponsor status` and verify daily and RPM bars start at zero
- submit one local test request through the sponsor route before sharing the peer

The consumer should only receive the sponsor label, optional sponsor link, exposed model names, supported modality metadata, and live utilization. Raw upstream URLs, provider API keys, and internal endpoint names stay provider-side.

## Status Bars And Limits

Daily and request-rate bars show used quota over the configured limit. A full bar means the provider should reject or queue new work instead of silently accepting more requests.

| Metric | Meaning | Enforcement Point |
| --- | --- | --- |
| Concurrency | In-flight requests for this sponsor | admission before dispatch |
| RPM | Rolling requests per minute | admission before dispatch |
| Daily tokens | Input plus output tokens for the current day | admission and post-response accounting |
| Peer tokens | Per-consumer token totals | post-response accounting |
| Model tokens | Per-model totals | post-response accounting |
| Media jobs | Per-modality job counts and duration/step budgets | modality router |

If status shows impossible values such as `8/5 concurrent`, treat that as a limit-enforcement bug, not a display issue. The provider should reject the sixth request before it reaches the backend.

## Directory Failure Cases

`Unexpected end of json input` usually means the directory request returned a partial body, empty body, or transport-truncated JSON. Triage it as a transport and serialization problem:

- check the nexus directory response body before parsing
- log the peer ID, endpoint, status code, content length, and first parse failure
- keep the last good directory snapshot until a complete replacement arrives
- show stale age in `/sponsor status` so consumers can distinguish stale cache from no peers
- never replace a valid peer cache with a failed parse result

## COHERE Operations

COHERE status should be grouped rather than flattened:

| Section | Fields |
| --- | --- |
| Daemon | active flag, pid, uptime, last query, connected peers |
| Results | answered, errors, sent bytes, received bytes, average latency |
| Models | exposed, hidden, allowlist state, downloaded inventory |
| Usage | requests per peer, tokens per peer, tokens per model |
| Failures | recent raw failure events and peer/model involved |

Model exposure should be deduplicated before rendering. A status output that repeats `Allowlist` and the same model multiple times indicates the inventory merger is appending display rows instead of merging model identities.
