Public · model routing

Paperclip OpenRouter Adapter

A public external adapter that lets Paperclip agents run through OpenRouter chat completions while keeping Paperclip issue tools, comments, status updates, and usage metadata intact.

Public repo Model routing Package verified

Problem

Agent platforms need more model routing choices without breaking their own workflow model. The hard part is not calling a model API; it is preserving the host application's issue lifecycle, tool contract, comments, status updates, and runtime accounting.

What I Built

Paperclip OpenRouter Adapter registers a new Paperclip adapter type, resolves OpenRouter configuration, turns a Paperclip heartbeat into an issue-aware prompt, runs a chat-completions tool loop, exposes Paperclip board tools to the model, and writes the result back as issue comments and status changes.

Adapter boundary External Paperclip adapter registration, server entrypoint, and UI parser export.
Model routing OpenRouter model catalog support with defaults, model profiles, token limits, transforms, and route configuration.
Tool loop Issue reads, status updates, comments, sub-issues, agent listing, and usage/cost metadata.
Paperclip OpenRouter adapter architecture diagram showing Paperclip heartbeat, adapter execution, OpenRouter loop, Paperclip tools, board outcome, runtime metadata, and package proof.
Public-safe architecture diagram grounded in the local source. It shows the integration boundary without exposing API keys, private boards, issue data, or live model output.
Sanitized Paperclip OpenRouter demo transcript showing build, smoke test, fake heartbeat, issue status update, comment tool call, done transition, and usage metadata boundary.
Sanitized demo-board transcript. It shows the intended adapter runtime shape with fake issue ids and redacted provider metadata; no API key, private board URL, real issue data, or model output is exposed.
Disposable Paperclip board screenshot showing a fake DEMO-42 issue, OpenRouter heartbeat timeline, tool calls, runtime metrics, and public-safe final comment.
Disposable board screenshot rendered from a public-safe fixture. It shows the product surface the adapter supports while keeping the board data fake, API keys out of frame, provider details bounded, and local/private state absent.

System Architecture

Technical Decisions

  • Keep the adapter scoped to Paperclip board tools rather than pretending it can edit local files.
  • Support any OpenRouter model id while providing sane defaults and a cheap profile.
  • Return model, provider, token, cost, generation, and turn metadata when OpenRouter reports it.
  • Package the adapter through normal npm exports so the UI parser and server entrypoint can load cleanly.

What This Proves

This is clean developer-tooling proof: adapter contracts, model-provider integration, tool-loop execution, typed API boundaries, and package discipline in a small public repo.