Skip to content

Releases: euwars/OpenrouterForFoundationModels

0.3.0 — Xcode 27.0 GM alignment

Choose a tag to compare

@euwars euwars released this 11 Sep 14:30

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 OpenRouterCitationSegment custom segments (the SDK 27 release removed custom transcript segments). They live on the response entry's metadata under OpenRouterMetadata.citations as [OpenRouterCitation]; read them with Transcript.Response.openRouterCitations. Same fields (URL, title, excerpt, character range), now also round-tripped by Transcript's Codable encoding.
  • Request metadata (OpenRouterMetadata.user, .sessionID) and response metadata (.servedTier, .cost) follow the SDK's GeneratedContent values.
  • Requires ServerFoundationModels 0.8.0 under the ServerFoundationModels trait.

0.2.0

Choose a tag to compare

@euwars euwars released this 07 Aug 08:41

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 configuration

Fixed

  • 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 ServerFoundationModels trait is spelled once, in FoundationModelsExports.swift, instead of in all 15 source, test, and example files. The trait and its conditional dependency in Package.swift are 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

Choose a tag to compare

@euwars euwars released this 06 Aug 20:36

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_schema with schema sanitization, the
    strict-mode rewrite, automatic provider.require_parameters, and
    optional client-side validation retries (structuredOutputRetries)
  • @Guide bounds on the wire with a measured per-vendor fidelity table
    (VendorDefaults, seeded by ModelConformanceTests) and an automatic
    minimal-schema fallback for providers that reject constraint keywords
  • Reasoning: effort/budget policies, framework hint mapping, and verbatim
    reasoning_details replay across tool turns
  • openrouter:web_search server tool with OpenRouterCitationSegment
    citations
  • Prompt caching: top-level automatic cache_control for Anthropic-family
    models, per-block breakpoints elsewhere; session_id sticky 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
  • ServerFoundationModels package trait (requires 0.7.0): the same bridge
    compiles against euwars/ServerFoundationModels — Linux included,
    verified in CI on the swift:6.2 container