Answers from the documentation; checking which model is on duty
Hi - I answer from the OpenSmartRoute documentation: routing, the API, plans and quotas, self-hosting. Ask away, or open a support ticket if you need a person.
Grounded in the docs - follow a source before acting on it.
Imported from spences10/svelte-skills-kit (plugins/svelte-skills/skills/svelte-template-directives/SKILL.md). Install upstream with npx skills add spences10/svelte-skills-kit --skill svelte-template-directives. Copyright stays with the author.
Svelte Template Directives
@attach (Svelte 5.29+)
The reactive alternative to use: actions. Re-runs when dependencies
change, passes through components via spread, supports cleanup functions.
<script> import ImageZoom from 'js-image-zoom'; function useZoom(options) { return (element) => { new ImageZoom(element, options); return () => console.log('cleanup'); }; }</script><!-- Re-runs if options changes (use: wouldn't!) --><figure {@attach useZoom({ width: 400 })}> <img src="photo.jpg" alt="zoomable" /></figure>
Use fromAction from svelte/attachments to convert legacy actions
Attachments pass through wrapper components when you spread props
Always use keyed each blocks — never use index as key
Use <svelte:window>/<svelte:document> for global events, not $effect
Last verified: 2026-03-12
Installed into a catalogue, chosen by a router
Install svelte-template-directives and it becomes one more candidate the router can pick - when it fits.
A listing is a routing target with a manifest: what it does, which domains it covers, what it costs and who publishes it. Once installed it sits beside your own models and tools, is scored like any other candidate for each request, and shows up in the trace when it wins. Ratings come from workspaces that installed it, one per account.
When a provider is down or over quota the request moves on; the trace says it did.
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
# after Install: the listing is in your workspace's routing pool - a plan picks it for its slotcurl-s-X POST https://api.opensmartroute.ai/api/v1/route -H 'Authorization: Bearer $OSR_API_KEY' -H 'Content-Type: application/json' -d '{"text": "...", "plan": true}'
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.