Summary
The v21 migration rewrites an AngularFire 20 app's getVertexAI(...) calls to
getAI(app, { backend: new VertexAIBackend() }). Two things are wrong with the class it picks.
VertexAIBackend is marked @deprecated - Use AgentPlatformBackend instead in the Firebase SDK.
AgentPlatformBackend does not appear anywhere in src/ or docs/, so the deprecation is unaddressed
across the whole package, not only in the migration.
The larger problem is where that class sends requests. new VertexAIBackend() with no argument resolves
to us-central1, and new AgentPlatformBackend() resolves to global, which is the location Firebase
suggests when a model supports it and the only location that serves the Gemini 3.x models.
What a developer sees
An AngularFire 20 app calling getVertexAI(app) runs ng update, changes nothing else, and lands on a
deprecated class in a location where a current model returns a bare 404 with no explanation.
Measured against one live project, two calls a few minutes apart differing only in the backend class:
| Backend |
Location |
Result for gemini-3.7-flash |
new VertexAIBackend() |
us-central1 |
404, Publisher model ... was not found |
new AgentPlatformBackend() |
global |
200, model responded |
The fix
Emit AgentPlatformBackend. A call that passed a location option would keep it, so only calls that
passed none, or a falsy one, would change location. That is a behavior change an automated rewrite
should not make quietly, so the migration should warn once for each file whose location moved, and
separately where a location is an expression that only runtime can resolve.
One case would need its own warning. Firebase does not serve the Live API models from global, so an
app calling getLiveGenerativeModel or startAudioConversation should not be left there. The
migration could look for either of those across the workspace and say so in the warning.
Dependency
AgentPlatformBackend first appears in @firebase/ai 2.14.0, which firebase 12.17.0 is the first
release to bundle. The package declares firebase ^12.4.0, so the emitted class does not exist at the
bottom of its own supported range. This cannot ship until that minimum rises, which is #3756.
Summary
The v21 migration rewrites an AngularFire 20 app's
getVertexAI(...)calls togetAI(app, { backend: new VertexAIBackend() }). Two things are wrong with the class it picks.VertexAIBackendis marked@deprecated - Use AgentPlatformBackend insteadin the Firebase SDK.AgentPlatformBackenddoes not appear anywhere insrc/ordocs/, so the deprecation is unaddressedacross the whole package, not only in the migration.
The larger problem is where that class sends requests.
new VertexAIBackend()with no argument resolvesto
us-central1, andnew AgentPlatformBackend()resolves toglobal, which is the location Firebasesuggests when a model supports it and the only location that serves the Gemini 3.x models.
What a developer sees
An AngularFire 20 app calling
getVertexAI(app)runsng update, changes nothing else, and lands on adeprecated class in a location where a current model returns a bare 404 with no explanation.
Measured against one live project, two calls a few minutes apart differing only in the backend class:
gemini-3.7-flashnew VertexAIBackend()us-central1404,Publisher model ... was not foundnew AgentPlatformBackend()global200, model respondedThe fix
Emit
AgentPlatformBackend. A call that passed alocationoption would keep it, so only calls thatpassed none, or a falsy one, would change location. That is a behavior change an automated rewrite
should not make quietly, so the migration should warn once for each file whose location moved, and
separately where a
locationis an expression that only runtime can resolve.One case would need its own warning. Firebase does not serve the Live API models from
global, so anapp calling
getLiveGenerativeModelorstartAudioConversationshould not be left there. Themigration could look for either of those across the workspace and say so in the warning.
Dependency
AgentPlatformBackendfirst appears in@firebase/ai2.14.0, which firebase 12.17.0 is the firstrelease to bundle. The package declares
firebase ^12.4.0, so the emitted class does not exist at thebottom of its own supported range. This cannot ship until that minimum rises, which is #3756.