Repository navigation
Releases: euwars/OpenrouterForFoundationModels
Release list
0.3.0 — Xcode 27.0 GM alignment
Builds against the Xcode 27.0 GM in both trait configurations (Apple's framework, and ServerFoundationModels 0.8.0).
- Breaking: web-search citations are no longer
OpenRouterCitationSegmentcustom segments (the SDK 27 release removed custom transcript segments). They live on the response entry's metadata underOpenRouterMetadata.citationsas[OpenRouterCitation]; read them withTranscript.Response.openRouterCitations. Same fields (URL, title, excerpt, character range), now also round-tripped byTranscript's Codable encoding. - Request metadata (
OpenRouterMetadata.user,.sessionID) and response metadata (.servedTier,.cost) follow the SDK'sGeneratedContentvalues. - Requires ServerFoundationModels 0.8.0 under the
ServerFoundationModelstrait.
0.2.0
One import is now enough
import OpenRouterForFoundationModels alone resolves LanguageModelSession, @Generable, and the rest of the framework surface — the module re-exports whichever framework it was built against. Previously a consumer had to add the matching import themselves, and which one was correct depended on the ServerFoundationModels trait they set, which the installation docs got wrong for trait users. Existing code that imports the framework explicitly keeps working.
import OpenRouterForFoundationModels // that's it, under either trait configurationFixed
- The ServerFoundationModels dependency floor said
from: "0.6.0"while 0.1.0 had already removed the 0.6.0 compatibility shims. Local resolution happened to pick 0.7.0 so it never surfaced, but a consumer pinned to 0.6.x would have failed to compile. The manifest now requires 0.7.0, matching what 0.1.0 documented.
Internal
- The
ServerFoundationModelstrait is spelled once, inFoundationModelsExports.swift, instead of in all 15 source, test, and example files. The trait and its conditional dependency inPackage.swiftare unchanged.
Both trait configurations build and pass 123 tests, matching the 0.1.0 baseline exactly; Linux CI is green under the ServerFoundationModels backend.
0.1.0
Initial release: OpenRouter as a Foundation Models server-side language model.
- Any OpenRouter model ID via
LanguageModelSession— streaming, tool
calling, guided generation, reasoning - Strict
response_format: json_schemawith schema sanitization, the
strict-mode rewrite, automaticprovider.require_parameters, and
optional client-side validation retries (structuredOutputRetries) @Guidebounds on the wire with a measured per-vendor fidelity table
(VendorDefaults, seeded byModelConformanceTests) and an automatic
minimal-schema fallback for providers that reject constraint keywords- Reasoning: effort/budget policies, framework hint mapping, and verbatim
reasoning_detailsreplay across tool turns openrouter:web_searchserver tool withOpenRouterCitationSegment
citations- Prompt caching: top-level automatic
cache_controlfor Anthropic-family
models, per-block breakpoints elsewhere;session_idsticky routing - Service tiers (
flex/priority/fast); served tier and generation cost
surfaced on response transcript metadata - Image normalization (orientation, downscale, metadata-free JPEG)
- Typed errors incl. moderation →
guardrailViolation,content_filter
and refusal finishes, and request correlators ServerFoundationModelspackage trait (requires 0.7.0): the same bridge
compiles against euwars/ServerFoundationModels — Linux included,
verified in CI on theswift:6.2container