Skip to content

Complete Hybrid inference impl #8966

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

Open
wants to merge 3 commits into
base: dl/genai
Choose a base branch
from
Open

Complete Hybrid inference impl #8966

wants to merge 3 commits into from

Conversation

gsiddh
Copy link

@gsiddh gsiddh commented Apr 23, 2025

Fix languageCode parameter in action_code_url (#8912)

  • Fix languageCode parameter in action_code_url

  • Add changeset

Vaihi add langmodel types. (#8927)

Define HybridParams (#8935)

Co-authored-by: Erik Eldridge [email protected]

Adding smoke test for new hybrid params (#8937)

  • Adding smoke test for new hybrid params

  • Use the existing name of the model params input


Co-authored-by: Erik Eldridge [email protected]

Moving to in-cloud naming (#8938)

Co-authored-by: Erik Eldridge [email protected]

Moving to string type for the inference mode (#8941)

Define ChromeAdapter class (#8942)

Co-authored-by: Erik Eldridge [email protected]

VinF Hybrid Inference: Implement ChromeAdapter (rebased) (#8943)

Adding count token impl (#8950)

VinF Hybrid Inference #4: ChromeAdapter in stream methods (rebased) (#8949)

Define values for Availability enum (#8951)

VinF Hybrid Inference: narrow Chrome input type (#8953)

Add image inference support (#8954)

  • Adding image based input for inference

  • adding image as input to create language model object

disable count tokens api for on-device inference (#8962)

VinF Hybrid Inference: throw if only_on_device and model is unavailable (#8965)

Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:

Discussion

  • Read the contribution guidelines (CONTRIBUTING.md).
  • If this has been discussed in an issue, make sure to link to the issue here.
    If not, go file an issue about this before creating a pull request to discuss.

Testing

  • Make sure all existing tests in the repository pass after your change.
  • If you fixed a bug or added a feature, add a new test to cover your code.

API Changes

  • At this time we cannot accept changes that affect the public API. If you'd like to help
    us make Firebase APIs better, please propose your change in an issue so that we
    can discuss it together.

Copy link

changeset-bot bot commented Apr 23, 2025

⚠️ No Changeset found

Latest commit: fafa6a8

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

@gsiddh gsiddh force-pushed the vaihi-exp-google-ai branch from cae765f to 92aa31a Compare April 23, 2025 18:37
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 23, 2025

Size Report 1

Affected Products

  • @firebase/vertexai

    TypeBase (475c81a)Merge (14ba360)Diff
    browser41.3 kB46.0 kB+4.69 kB (+11.4%)
    main42.4 kB47.1 kB+4.69 kB (+11.0%)
    module41.3 kB46.0 kB+4.69 kB (+11.4%)
  • firebase

    TypeBase (475c81a)Merge (14ba360)Diff
    firebase-vertexai.js32.7 kB36.1 kB+3.38 kB (+10.3%)

Test Logs

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

@gsiddh gsiddh force-pushed the vaihi-exp-google-ai branch 3 times, most recently from 5786936 to 258c622 Compare April 23, 2025 18:58
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 23, 2025

Size Analysis Report 1

This report is too large (89,334 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

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

@gsiddh gsiddh force-pushed the vaihi-exp-google-ai branch from 258c622 to 3f5ebab Compare April 23, 2025 18:59
Fix languageCode parameter in action_code_url (#8912)

* Fix languageCode parameter in action_code_url

* Add changeset

Vaihi add langmodel types. (#8927)

* Adding LanguageModel types. These are based off https://github.com/webmachinelearning/prompt-api?tab=readme-ov-file#full-api-surface-in-web-idl

* Adding LanguageModel types.

* Remove bunch of exports

* yarn formatted

* after lint

Define HybridParams (#8935)

Co-authored-by: Erik Eldridge <[email protected]>

Adding smoke test for new hybrid params (#8937)

* Adding smoke test for new hybrid params

* Use the existing name of the model params input

---------

Co-authored-by: Erik Eldridge <[email protected]>

Moving to in-cloud naming (#8938)

Co-authored-by: Erik Eldridge <[email protected]>

Moving to string type for the inference mode (#8941)

Define ChromeAdapter class (#8942)

Co-authored-by: Erik Eldridge <[email protected]>

VinF Hybrid Inference: Implement ChromeAdapter (rebased) (#8943)

Adding count token impl (#8950)

VinF Hybrid Inference #4: ChromeAdapter in stream methods (rebased) (#8949)

Define values for Availability enum (#8951)

VinF Hybrid Inference: narrow Chrome input type (#8953)

Add image inference support (#8954)

* Adding image based input for inference

* adding image as input to create language model object

disable count tokens api for on-device inference (#8962)

VinF Hybrid Inference: throw if only_on_device and model is unavailable (#8965)
@gsiddh gsiddh force-pushed the vaihi-exp-google-ai branch from 3f5ebab to abf0491 Compare April 23, 2025 19:00
private mode?: InferenceMode,
private onDeviceParams: LanguageModelCreateOptions = {}
) {
this.addImageTypeAsExpectedInput();
Copy link

Choose a reason for hiding this comment

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

This should happen only if necessary.

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.

5 participants