Skip to content

Document dynamic profiles - #317

Merged
mattt merged 187 commits into
huggingface:mainfrom
qoli:codex/upstream-dynamic-profile-docs
Nov 6, 2026
Merged

mattt merged 187 commits into
huggingface:mainfrom
qoli:codex/upstream-dynamic-profile-docs

Conversation

@qoli

@qoli qoli commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

This PR documents dynamic profiles in the README, now that the implementation has landed on main. It adds a "Dynamic Profiles" section, an entry under "Differences from Foundation Models", and a note under "Tool Calling" about what a stopped response returns. The branch merges main, and README.md is the only file that differs from it.

The section covers modifier and callback order, per-session callback serialization, and which providers run onToolCall and onToolOutput. It also states the current limits: MLX and llama.cpp evaluate a profile once per response, and a native continuation keeps its session's model and options.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Streaming context propagation, callback error policy, and protected continuation history have unresolved correctness issues.

3 open findings
What changed in this PR

Implements and documents Foundation Models 27-compatible dynamic profiles, session properties, request options, and provider Tool continuations.

Changes:

  • Adds dynamic profile composition, lifecycle callbacks, session properties, and request options.
  • Supports profile reevaluation and model handoff across remote providers.
  • Adds compatibility, lifecycle, continuation, and serialization tests plus README guidance.
File Description
Tests/​AnyLanguageModelTests/​SessionPropertyTests.swift Tests session properties and history behavior.
Tests/​AnyLanguageModelTests/​RequestOptionsTests.swift Tests request-option compatibility.
Tests/​AnyLanguageModelTests/​ProviderUsageTests.swift Tests provider profile continuations.
Tests/​AnyLanguageModelTests/​FoundationModelsGenerationOptionsTests.swift Tests Foundation Models option bridging.
Tests/​AnyLanguageModelTests/​DynamicProfileTests.swift Tests profiles and lifecycle behavior.
Tests/​AnyLanguageModelTests/​APICompatibilityFoundationModelsTests.swift Checks Foundation Models API compatibility.
Tests/​AnyLanguageModelTests/​APICompatibilityAnyLanguageModelTests.swift Checks AnyLanguageModel compatibility.
Tests/​AnyLanguageModelTests/​AnthropicReasoningTests.swift Covers non-streaming Anthropic continuation.
Sources/​AnyLanguageModelMacros/​SessionPropertyEntryMacro.swift Generates session-property storage accessors.
Sources/​AnyLanguageModelMacros/​Plugin.swift Registers the new macro.
Sources/​AnyLanguageModel/​SessionProperties.swift Implements session-scoped properties and history.
Sources/​AnyLanguageModel/​ProfileToolExecution.swift Centralizes profile-aware Tool execution and handoff.
Sources/​AnyLanguageModel/​Models/​SystemLanguageModel.swift Bridges Tool-calling mode.
Sources/​AnyLanguageModel/​Models/​OpenResponsesLanguageModel.swift Adds profile-aware continuations.
Sources/​AnyLanguageModel/​Models/​OpenAILanguageModel.swift Adds profile-aware continuations.
Sources/​AnyLanguageModel/​Models/​OllamaLanguageModel.swift Adds multi-round profile continuations.
Sources/​AnyLanguageModel/​Models/​GeminiLanguageModel.swift Adds profile-aware continuations.
Sources/​AnyLanguageModel/​Models/​AnthropicLanguageModel.swift Adds non-streaming Tool continuations.
Sources/​AnyLanguageModel/​LanguageModelSession.swift Integrates profile resolution and callbacks.
Sources/​AnyLanguageModel/​GenerationOptions.swift Adds OS 27-compatible options.
Sources/​AnyLanguageModel/​DynamicProfile.swift Defines dynamic profile composition.
Sources/​AnyLanguageModel/​DynamicInstructions.swift Exposes instruction resolution internally.
Sources/​AnyLanguageModel/​ContextOptions.swift Defines request-context options.
README.md Documents request options and profiles.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

qoli and others added 28 commits October 22, 2026 09:26
@mattt
mattt marked this pull request as ready for review November 6, 2026 08:58
@mattt
mattt merged commit b7caacf into huggingface:main Nov 6, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants