Add models frontmatter field for custom model pricing#38276
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
June 10, 2026 04:09
View session
Collaborator
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in 7e7a8bd / e8dc1fd.
Usage: models:
providers:
anthropic:
models:
my-custom-claude:
cost:
input: "3e-06"
output: "1.5e-05" |
Copilot
AI
changed the title
Add
Add Jun 10, 2026
model-costs frontmatter field for custom model pricingmodels frontmatter field for custom model pricing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflows currently have no way to declare pricing for custom or private models, nor to override built-in cost entries. This adds a
modelsfrontmatter field (using the same structure asmodels.json) that merges intomodels.jsonat runtime before AWF receives it.Approach
Mirrors the existing
model_multipliers.jsonmerge pattern exactly:modelsoverlay to JSON → emits asGH_AW_INFO_MODEL_COSTSin the activation jobgenerate_aw_info.cjsmerges it over the built-inmodels.json→ writes/tmp/gh-aw/models.json/tmp/gh-aw/models.json; agent job receives it viaGH_AW_MODELS_JSON_PATHMerge semantics: overlay wins at model granularity (whole model entry replaced); unmentioned providers/models preserved from base.
The
modelsfield is disambiguated at parse time: when the value contains a top-levelproviderskey it is treated as a models.json overlay; otherwise it falls through to the deprecated alias-map format for backward compatibility.Changes
frontmatter_types.go,frontmatter_parsing.go,compiler_types.go,workflow_builder.go,compiler_yaml.go) — parse and emit the new field;ParseFrontmatterConfigdetects theproviders-keyed structure and routes it toModelCostsawf_helpers.go—GH_AW_MODELS_JSON_PATHnow points to/tmp/gh-aw/models.json(the merged file) instead of the setup-copied originalcompiler_activation_job_builder.go— include/tmp/gh-aw/models.jsonin activation artifact uploadmerge_frontmatter_models.cjs(new) —mergeModelCosts()+writeMergedModelsJSON(); called fromgenerate_aw_info.cjsmain_workflow_schema.json—modelsproperty updated tooneOf: providers structure (new) or deprecated alias-array format (backward compat)Usage