Skip to content

Composition

Stack LoRAs on a base checkpoint — including assets you don't own — through one endpoint, with every component owner paid automatically.

Create a composed endpoint

curl -X POST -H "Authorization: Bearer $EPM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "base_model_id": "mdl_...",
        "composition": [
          {"model_id": "mdl_lora_a", "scale": 0.8},
          {"model_id": "mdl_lora_b"}
        ]
      }' \
  https://epm-router.uridemay.workers.dev/v1/endpoints

Rules the API enforces:

  • Up to 5 LoRAs, no duplicates, scale in (0, 2] (default 1.0).
  • Components must be LoRAs of the base's family, parked and verified.
  • A third-party component must be listed and composable — owners can pull their asset out of new third-party compositions at any time with the composable flag (existing endpoints stop serving it too).
  • The stored composition is canonically ordered (sorted by model id), whatever order you send. Fusion is additive but not bitwise order-independent, so the order is part of the served identity — your endpoint renders the same bytes forever.

Generate with POST /v1/endpoints/{endpoint_id}/generate — same body, same 202 ladder, same determinism as a plain model. The first composed render pays a one-time fuse cost (seconds); repeats at the same composition hit tier_hit: live.

Who pays whom

One generation produces one atomic ledger event:

you pay:            floor + Σ spreads
platform receives:  floor
each owner:         floor × (k_owner − 1) per listed component

Example: base at 2×, one LoRA at 3×, one at 2×, floor $0.001 → you pay $0.005; the base owner earns $0.001, the LoRA owners $0.002 and $0.001. Your own components ride at floor — self-composition costs exactly the floor.

Ad-hoc LoRAs

By default an endpoint serves its stored recipe only — loras in the generate body returns 403 adhoc_loras_locked. Create the endpoint with "allow_adhoc_loras": true to allow per-request additions (they merge over the stored composition, same validation, same payouts).

Proof

GET /v1/endpoints/{id}/attestation signs the base and the ordered component list — source identity, measured file hash, and scale for every layer of the stack. Verify it offline.