mirror of
https://github.com/Routstr/protocol.git
synced 2026-08-08 23:34:42 +00:00
update proxy discovery
This commit is contained in:
@@ -1,23 +1,64 @@
|
||||
# RIP-02: Node Listing
|
||||
|
||||
- [ ] Create PR to the Nostr repo to add a new Kind 40500 event
|
||||
Nodes announce their presence and capabilities via Nostr events for client discovery, following NIP-91.
|
||||
|
||||
Nodes announce their presence and capabilities via a Nostr event for client discovery.
|
||||
## Provider Information Event
|
||||
|
||||
**Kind**: 40500
|
||||
**Kind**: 38421
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 40500,
|
||||
"kind": 38421,
|
||||
"pubkey": "<routstr-provider-pubkey>",
|
||||
"created_at": <unix-timestamp>,
|
||||
"content": "<optional-kind:0-style-metadata>",
|
||||
"tags": [
|
||||
["d", "<node-id>"], // Unique node identifier
|
||||
["p", "<operator-pubkey>"],
|
||||
["url", "https://..."], // Inference endpoint
|
||||
["onion", "<tor-onion-address>"], // Tor hidden service endpoint
|
||||
],
|
||||
"content": "Human-readable description"
|
||||
["d", "<unique-provider-identifier>"],
|
||||
["u", "https://..."], // HTTP endpoint
|
||||
["u", "<tor-onion-address>"], // Tor hidden service endpoint
|
||||
["models", "gpt-4o-mini", "gpt-4o", "claude-3-5-sonnet", "..."],
|
||||
["mint", "https://mint.example.com"],
|
||||
["version", "0.0.1"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Clients subscribe to Kind 40500, index by `d` tag, and override older listings with newer events.
|
||||
### Model Capabilities (Optional)
|
||||
|
||||
Providers MAY include additional tags to describe model-specific capabilities:
|
||||
|
||||
```json
|
||||
{
|
||||
"tags": [
|
||||
["model-cap", "gpt-4o", "max_tokens:128000,vision:true,tools:true"],
|
||||
["model-cap", "claude-3-5-sonnet", "max_tokens:200000,vision:true,tools:true"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Recommendation Event
|
||||
|
||||
**Kind**: 38000 (as defined in NIP-87)
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 38000,
|
||||
"pubkey": "<recommender-user-pubkey>",
|
||||
"tags": [
|
||||
["k", "38421"],
|
||||
["d", "<d-identifier>"],
|
||||
["u", "<recommended-routstr-http-url>"],
|
||||
["a", "38421:routstr-provider-pubkey:<d-identifier>", "wss://relay1"]
|
||||
],
|
||||
"content": "Fast and reliable AI proxy with great model selection"
|
||||
}
|
||||
```
|
||||
|
||||
## Discovery
|
||||
|
||||
Clients can discover providers by:
|
||||
|
||||
1. Querying for `kind:38000` events with `#k` filter for `38421` (recommendations)
|
||||
2. Directly querying for `kind:38421` events (provider announcements)
|
||||
|
||||
Provider events are replaceable by the `d` tag, with newer events overriding older listings.
|
||||
|
||||
Reference in New Issue
Block a user