ModelRelay runs RLM—it writes queries, reads the results, and reasons across them to answer. No vector DB. No chunking. Across any model, in your boundary. Embed it in your product, and bill your users per run.
from modelrelay import ModelRelay
mr = ModelRelay(api_key="mr_sk_...")
answer = mr.rlm.execute(
model="claude-sonnet-5",
query="Which customers churned last quarter, and what did they have in common?",
data_source={
"type": "sql",
"url": "postgres://[email protected]/app", # read-only
},
)
print(answer.text)import { ModelRelay } from "@modelrelay/sdk";
const mr = ModelRelay.fromSecretKey("mr_sk_...");
const answer = await mr.rlm.execute({
model: "claude-sonnet-5",
query: "Which customers churned last quarter, and what did they have in common?",
dataSource: {
type: "sql",
url: "postgres://[email protected]/app", // read-only
},
});
console.log(answer.text);Answers over your data. No pipeline.
RLM inspects your schema, writes SQL, reads the rows, and decides what to ask next—iterating until it can answer. The model navigates your data with code, so only the slices it needs ever enter the context window.
No embeddings. No chunking. No reranking. For structured data you don't retrieve—you query.
Run RLM next to your database—in your VPC, or on-device. The model queries your data locally and only the slices it needs are sent as subcalls, across any lab you choose.
Put it in your product.
Stream the reasoning trajectory and typed results as the model queries your data—render rows as they arrive instead of waiting for the full response.
stream = mr.rlm.stream(
model="claude-sonnet-5",
query="Top 5 customers by revenue, one-line reason each",
data_source={"type": "sql", "url": "postgres://readonly@db/app"},
)
for event in stream:
if event.type == "progress":
print(event.status) # watch it reason
elif event.type == "answer":
render(event.rows)const stream = await mr.rlm.stream({
model: "claude-sonnet-5",
query: "Top 5 customers by revenue, one-line reason each",
dataSource: { type: "sql", url: "postgres://readonly@db/app" },
});
for await (const event of stream) {
if (event.type === "progress") console.log(event.status); // watch it reason
if (event.type === "answer") render(event.rows);
}Use your existing auth stack, then mint ModelRelay customer tokens from your backend. Keep identity in your hands while we meter usage.
Bill your users. Keep the margin.
One question from your user fans out into a tree of subcalls—variable depth, multiple models. Because ModelRelay runs the loop, it meters every hop and attributes the whole run to the customer who asked. A live cost basis per user, per run.
Set your tiers and prices on top, and keep the margin—there's no platform fee.
A billing proxy sees eighteen unrelated API calls. The runtime that executes the loop sees one run, one customer, one cost.
Connect a database, ask anything, and meter every user from day one.