Skip to content

feat(ldai): stamp modelKey and modelVersion on AI usage events (AIC-2850)#414

Open
atornsii wants to merge 1 commit into
v7from
atornsii/AIC-2850/add-support-for-model-key-version
Open

feat(ldai): stamp modelKey and modelVersion on AI usage events (AIC-2850)#414
atornsii wants to merge 1 commit into
v7from
atornsii/AIC-2850/add-support-for-model-key-version

Conversation

@atornsii

@atornsii atornsii commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • Read modelKey and modelVersion from the AI Config variation payload (model.modelKey / model.modelVersion) and expose them on Config via ModelKey() / ModelVersion() accessors and builder methods
  • Stamp modelKey (when present) and modelVersion on all Tracker metric event payloads, alongside existing modelName/providerName fields
  • Default modelVersion to 1 when absent, matching variation version handling; exclude both fields from the resumption token
  • Additive/backward compatible — older payloads without the new fields continue to work

Part of AIC-2850 / AIC-2849. Depends on backend payload work (AIC-2876) shipping modelKey/modelVersion on variations.

Test plan

  • go build ./... in ldai/
  • go vet ./... in ldai/
  • go test ./... in ldai/ (all passed)
  • Verify against a staging environment once AIC-2876 payload is available

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Describe the solution you've provided

The Go AI SDK now parses modelKey and modelVersion from the variation's model object, exposes them through Config accessors, and includes them in the trackData stamped on every metric event. modelVersion is always emitted (defaulting to 1); modelKey is omitted when empty. Neither field is included in the resumption token.

Describe alternatives you've considered

Threading modelKey/modelVersion as explicit constructor parameters to newTracker (as in the Python SDK PR) was considered but rejected in favor of sourcing from Config, matching the existing modelName/providerName pattern.

Additional context

Mirrors python-server-sdk-ai#208.

Open in Web Open in Cursor 

…850)

Read modelKey and modelVersion from the AI Config variation payload and expose
them on Config. Stamp both fields on every metric event alongside existing
modelName and providerName. modelVersion defaults to 1 when absent; modelKey is
omitted when empty. Neither field is included in the resumption token.

Additive and backward compatible with older payloads.

Co-authored-by: Anthony Torns II <atornsii@users.noreply.github.com>
@jsonbailey

Copy link
Copy Markdown
Contributor

Holding based on our conversation today and we will follow up on slack before reviewing.

@jsonbailey

Copy link
Copy Markdown
Contributor

We are also in the process of migrating this to the go-server-sdk-ai repository.

@atornsii atornsii marked this pull request as ready for review July 9, 2026 20:31
@atornsii atornsii requested a review from a team as a code owner July 9, 2026 20:31
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