Skip to content
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

VinF Hybrid Inference #1: Update the API #8874

Open
wants to merge 12 commits into
base: vertexai-hybridinference-integration
Choose a base branch
from

Conversation

erikeldridge
Copy link

This change updates the getGenerativeModel getter to accept ModelParams or HybridParams. The HybridParams.mode field indicates whether hybrid inference is intended.

This change just updates the inputs. All existing tests pass, so the diff should be relatively easy to understand. The next change will use the inputs.

@erikeldridge erikeldridge requested a review from hsubox76 March 27, 2025 17:35
@erikeldridge erikeldridge requested a review from a team as a code owner March 27, 2025 17:35
Copy link

changeset-bot bot commented Mar 27, 2025

⚠️ No Changeset found

Latest commit: 814a1dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 27, 2025

Size Report 1

Affected Products

  • @firebase/vertexai

    TypeBase (dcc62c0)Merge (77a101c)Diff
    browser34.7 kB35.0 kB+272 B (+0.8%)
    main35.7 kB36.0 kB+272 B (+0.8%)
    module34.7 kB35.0 kB+272 B (+0.8%)
  • firebase

    TypeBase (dcc62c0)Merge (77a101c)Diff
    firebase-vertexai.js28.3 kB28.4 kB+168 B (+0.6%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/6tNnl82zeC.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 27, 2025

Size Analysis Report 1

Affected Products

  • @firebase/vertexai

    • GenerativeModel

      Size

      TypeBase (dcc62c0)Merge (77a101c)Diff
      size18.9 kB19.0 kB+57 B (+0.3%)
      size-with-ext-deps37.9 kB37.9 kB+57 B (+0.2%)
    • ImagenModel

      Size

      TypeBase (dcc62c0)Merge (77a101c)Diff
      size10.1 kB20.7 kB+10.6 kB (+105.8%)
      size-with-ext-deps28.1 kB39.7 kB+11.6 kB (+41.5%)

      Dependency

      TypeBase (dcc62c0)Merge (77a101c)Diff
      functions

      constructRequest
      createPredictRequestBody
      getClientHeaders
      getHeaders
      handlePredictResponse
      makeRequest
      registerVertex

      26 dependencies

      addHelpers
      aggregateResponses
      assignRoleToPartsAndValidateSendMessageRequest
      constructRequest
      countTokens
      createEnhancedContentResponse
      createPredictRequestBody
      formatBlockErrorMessage
      formatGenerateContentInput
      formatNewContent
      formatSystemInstruction
      generateContent
      generateContentStream
      generateResponseSequence
      getClientHeaders
      getFunctionCalls
      getHeaders
      getResponsePromise
      getResponseStream
      getText
      hadBadFinishReason
      handlePredictResponse
      makeRequest
      processStream
      registerVertex
      validateChatHistory

      19 dependency diffs

      + addHelpers
      + aggregateResponses
      + assignRoleToPartsAndValidateSendMessageRequest
      + countTokens
      + createEnhancedContentResponse
      + formatBlockErrorMessage
      + formatGenerateContentInput
      + formatNewContent
      + formatSystemInstruction
      + generateContent
      + generateContentStream
      + generateResponseSequence
      + getFunctionCalls
      + getResponsePromise
      + getResponseStream
      + getText
      + hadBadFinishReason
      + processStream
      + validateChatHistory

      classes

      ImagenModel
      RequestUrl
      VertexAIError
      VertexAIModel
      VertexAIService

      ChatSession
      GenerativeModel
      ImagenModel
      RequestUrl
      VertexAIError
      VertexAIModel
      VertexAIService

      + ChatSession
      + GenerativeModel

      variables

      24 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      + POSSIBLE_ROLES
      + SILENT_ERROR
      + VALID_PARTS_PER_ROLE
      + VALID_PART_FIELDS
      + VALID_PREVIOUS_CONTENT_ROLES
      + badFinishReasons
      + responseLineRE

      External Dependency

      ModuleBase (dcc62c0)Merge (77a101c)Diff
      tslib

      __asyncGenerator
      __await

      + __asyncGenerator
      + __await

    • VertexAIModel

      Size

      TypeBase (dcc62c0)Merge (77a101c)Diff
      size5.23 kB19.0 kB+13.7 kB (+262.6%)
      size-with-ext-deps23.2 kB37.9 kB+14.8 kB (+63.7%)

      Dependency

      TypeBase (dcc62c0)Merge (77a101c)Diff
      functions

      registerVertex

      24 dependencies

      addHelpers
      aggregateResponses
      assignRoleToPartsAndValidateSendMessageRequest
      constructRequest
      countTokens
      createEnhancedContentResponse
      formatBlockErrorMessage
      formatGenerateContentInput
      formatNewContent
      formatSystemInstruction
      generateContent
      generateContentStream
      generateResponseSequence
      getClientHeaders
      getFunctionCalls
      getHeaders
      getResponsePromise
      getResponseStream
      getText
      hadBadFinishReason
      makeRequest
      processStream
      registerVertex
      validateChatHistory

      23 dependency diffs

      + addHelpers
      + aggregateResponses
      + assignRoleToPartsAndValidateSendMessageRequest
      + constructRequest
      + countTokens
      + createEnhancedContentResponse
      + formatBlockErrorMessage
      + formatGenerateContentInput
      + formatNewContent
      + formatSystemInstruction
      + generateContent
      + generateContentStream
      + generateResponseSequence
      + getClientHeaders
      + getFunctionCalls
      + getHeaders
      + getResponsePromise
      + getResponseStream
      + getText
      + hadBadFinishReason
      + makeRequest
      + processStream
      + validateChatHistory

      classes

      VertexAIError
      VertexAIModel
      VertexAIService

      ChatSession
      GenerativeModel
      RequestUrl
      VertexAIError
      VertexAIModel
      VertexAIService

      + ChatSession
      + GenerativeModel
      + RequestUrl

      variables

      18 dependencies

      BlockReason
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      Modality
      SchemaType
      Task
      VERTEX_TYPE
      name
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      13 dependency diffs

      + DEFAULT_API_VERSION
      + DEFAULT_BASE_URL
      + DEFAULT_FETCH_TIMEOUT_MS
      + LANGUAGE_TAG
      + PACKAGE_VERSION
      + POSSIBLE_ROLES
      + SILENT_ERROR
      + VALID_PARTS_PER_ROLE
      + VALID_PART_FIELDS
      + VALID_PREVIOUS_CONTENT_ROLES
      + badFinishReasons
      + logger
      + responseLineRE

      External Dependency

      ModuleBase (dcc62c0)Merge (77a101c)Diff
      tslib

      __asyncGenerator
      __await

      + __asyncGenerator
      + __await

    • getGenerativeModel

      Size

      TypeBase (dcc62c0)Merge (77a101c)Diff
      size19.1 kB19.2 kB+153 B (+0.8%)
      size-with-ext-deps38.1 kB38.2 kB+153 B (+0.4%)
    • getImagenModel

      Size

      TypeBase (dcc62c0)Merge (77a101c)Diff
      size10.2 kB20.9 kB+10.7 kB (+104.1%)
      size-with-ext-deps28.2 kB39.9 kB+11.6 kB (+41.3%)

      Dependency

      TypeBase (dcc62c0)Merge (77a101c)Diff
      functions

      constructRequest
      createPredictRequestBody
      getClientHeaders
      getHeaders
      getImagenModel
      handlePredictResponse
      makeRequest
      registerVertex

      27 dependencies

      addHelpers
      aggregateResponses
      assignRoleToPartsAndValidateSendMessageRequest
      constructRequest
      countTokens
      createEnhancedContentResponse
      createPredictRequestBody
      formatBlockErrorMessage
      formatGenerateContentInput
      formatNewContent
      formatSystemInstruction
      generateContent
      generateContentStream
      generateResponseSequence
      getClientHeaders
      getFunctionCalls
      getHeaders
      getImagenModel
      getResponsePromise
      getResponseStream
      getText
      hadBadFinishReason
      handlePredictResponse
      makeRequest
      processStream
      registerVertex
      validateChatHistory

      19 dependency diffs

      + addHelpers
      + aggregateResponses
      + assignRoleToPartsAndValidateSendMessageRequest
      + countTokens
      + createEnhancedContentResponse
      + formatBlockErrorMessage
      + formatGenerateContentInput
      + formatNewContent
      + formatSystemInstruction
      + generateContent
      + generateContentStream
      + generateResponseSequence
      + getFunctionCalls
      + getResponsePromise
      + getResponseStream
      + getText
      + hadBadFinishReason
      + processStream
      + validateChatHistory

      classes

      ImagenModel
      RequestUrl
      VertexAIError
      VertexAIModel
      VertexAIService

      ChatSession
      GenerativeModel
      ImagenModel
      RequestUrl
      VertexAIError
      VertexAIModel
      VertexAIService

      + ChatSession
      + GenerativeModel

      variables

      24 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      SchemaType
      Task
      VERTEX_TYPE
      logger
      name
      version

      31 dependencies

      BlockReason
      DEFAULT_API_VERSION
      DEFAULT_BASE_URL
      DEFAULT_FETCH_TIMEOUT_MS
      DEFAULT_LOCATION
      FinishReason
      FunctionCallingMode
      HarmBlockMethod
      HarmBlockThreshold
      HarmCategory
      HarmProbability
      HarmSeverity
      ImagenAspectRatio
      ImagenPersonFilterLevel
      ImagenSafetyFilterLevel
      LANGUAGE_TAG
      Modality
      PACKAGE_VERSION
      POSSIBLE_ROLES
      SILENT_ERROR
      SchemaType
      Task
      VALID_PARTS_PER_ROLE
      VALID_PART_FIELDS
      VALID_PREVIOUS_CONTENT_ROLES
      VERTEX_TYPE
      badFinishReasons
      logger
      name
      responseLineRE
      version

      + POSSIBLE_ROLES
      + SILENT_ERROR
      + VALID_PARTS_PER_ROLE
      + VALID_PART_FIELDS
      + VALID_PREVIOUS_CONTENT_ROLES
      + badFinishReasons
      + responseLineRE

      External Dependency

      ModuleBase (dcc62c0)Merge (77a101c)Diff
      tslib

      __asyncGenerator
      __await

      + __asyncGenerator
      + __await

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/68NJ0UIBzq.html

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.

2 participants