Skip to content

Deprecate Firebase ML Model Downloader#8424

Open
emilypgoogle wants to merge 1 commit into
mainfrom
ep/deprecate-ml-modeldownloader
Open

Deprecate Firebase ML Model Downloader#8424
emilypgoogle wants to merge 1 commit into
mainfrom
ep/deprecate-ml-modeldownloader

Conversation

@emilypgoogle

Copy link
Copy Markdown
Contributor

Deprecate the FirebaseMLModelDownloader library within the Firebase Android SDK, reflecting its scheduled shutdown on June 15, 2027.

All public API symbols have been marked with @Deprecated and a corresponding javadoc description.
Added a deprecation notice to the changelog.
Further steps to remove the library and prevent release are not in scope of initial deprecation.

@github-actions

Copy link
Copy Markdown
Contributor

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@milaGGL

milaGGL commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates the Firebase ML Model Downloader library, adding deprecation notices to the CHANGELOG and applying @Deprecated annotations and Javadoc updates across Java and Kotlin files. The review feedback suggests extracting the repeated deprecation message in ModelDownloader.kt into a single private constant to avoid code duplication and improve maintainability.

Comment on lines +26 to +41
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
val Firebase.modelDownloader: FirebaseModelDownloader
get() = FirebaseModelDownloader.getInstance()

/** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app)

/** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The long deprecation message is repeated multiple times in this file. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, we can extract this message into a private const val at the top of the file and reference it in all @Deprecated annotations.

Suggested change
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
val Firebase.modelDownloader: FirebaseModelDownloader
get() = FirebaseModelDownloader.getInstance()
/** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app)
/** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
private const val DEPRECATION_MESSAGE =
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
@Deprecated(DEPRECATION_MESSAGE)
val Firebase.modelDownloader: FirebaseModelDownloader
get() = FirebaseModelDownloader.getInstance()
/** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */
@Deprecated(DEPRECATION_MESSAGE)
fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app)
/** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */
@Deprecated(DEPRECATION_MESSAGE)

Comment on lines +50 to +72
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component1(): File? = file

@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component2() = size

@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component3() = downloadId

@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component4() = modelHash

@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Use the newly defined DEPRECATION_MESSAGE constant here as well to eliminate duplication.

Suggested change
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component1(): File? = file
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component2() = size
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component3() = downloadId
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
operator fun CustomModel.component4() = modelHash
@Deprecated(
"Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage"
)
@Deprecated(DEPRECATION_MESSAGE)
operator fun CustomModel.component1(): File? = file
@Deprecated(DEPRECATION_MESSAGE)
operator fun CustomModel.component2() = size
@Deprecated(DEPRECATION_MESSAGE)
operator fun CustomModel.component3() = downloadId
@Deprecated(DEPRECATION_MESSAGE)
operator fun CustomModel.component4() = modelHash
@Deprecated(DEPRECATION_MESSAGE)

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