-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add provider model and token limit overrides to ProviderConfig #966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f993631
09c17f7
c434f4d
56af92f
726a2e6
6c794c4
fcbec67
6c2212b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1528,6 +1528,40 @@ public class ProviderConfig | |
| /// </summary> | ||
| [JsonPropertyName("headers")] | ||
| public IDictionary<string, string>? Headers { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Well-known model name used by the runtime to look up agent configuration | ||
| /// (tools, prompts, reasoning behavior) and default token limits. Also used | ||
| /// as the wire model when <see cref="WireModel"/> is not set. | ||
| /// Falls back to <see cref="SessionConfig.Model"/>. | ||
| /// </summary> | ||
| [JsonPropertyName("modelId")] | ||
| public string? ModelId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Model name sent to the provider API for inference. Use this when the | ||
| /// provider's model name (e.g. an Azure deployment name or a custom | ||
| /// fine-tune name) differs from <see cref="ModelId"/>. | ||
| /// Falls back to <see cref="ModelId"/>, then <see cref="SessionConfig.Model"/>. | ||
| /// </summary> | ||
| [JsonPropertyName("wireModel")] | ||
| public string? WireModel { get; set; } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of the three: what's the meaning behind ProviderConfig.ModelId having an "Id" suffix and the other two not?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figured the "ID" more strongly implied that the value was identifying a well-known model kind. We could also consider |
||
|
|
||
| /// <summary> | ||
| /// Overrides the resolved model's default max prompt tokens. The runtime | ||
| /// triggers conversation compaction before sending a request when the | ||
| /// prompt (system message, history, tool definitions, user message) would | ||
| /// exceed this limit. | ||
| /// </summary> | ||
| [JsonPropertyName("maxPromptTokens")] | ||
| public int? MaxInputTokens { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Overrides the resolved model's default max output tokens. When hit, the | ||
| /// model stops generating and returns a truncated response. | ||
| /// </summary> | ||
| [JsonPropertyName("maxOutputTokens")] | ||
| public int? MaxOutputTokens { get; set; } | ||
| } | ||
|
MackinnonBuck marked this conversation as resolved.
|
||
|
|
||
| /// <summary> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there's:
SessionConfig.Model
ProviderConfig.ModelId
ProviderConfig.WireModel
Help me understand the relationship? If I specify SessionConfig.Model, it's used as the default for both options on ProviderConfig, and those options on provider config then represent the two different groupings in which a model would be used, such that I can override one of them? Is there any situation where I would specify the same model ID for both ModelId and WireModel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only
ProviderConfig.ModelIdis specified, then that controls multiple things:If the model provider recognizes a model name that doesn't match the model ID known by the runtime, then
ProviderConfig.WireModelcan specify that.SessionConfig.Modelacts a default in case neither option is specified.It has the same effect as just specifying
ModelId, so it's not really necessary.