# Help - How to use Google Gemini Models with createDeepAgent

**URL:** https://forum.langchain.com/t/help-how-to-use-google-gemini-models-with-createdeepagent/2760
**Category:** LangGraph
**Tags:** js-help
**Created:** [January 20, 2026, 10:47am UTC](https://forum.langchain.com/t/help-how-to-use-google-gemini-models-with-createdeepagent/2760 "2026-01-20T10:47:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sa64r](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/sa64r/32/2191_2.png) [@sa64r](https://forum.langchain.com/u/sa64r)
#### Post date: [January 20, 2026, 10:47am UTC](https://forum.langchain.com/t/help-how-to-use-google-gemini-models-with-createdeepagent/2760/1 "2026-01-20T10:47:54Z")

</div>

Hey,

**TLDR: How do I get Gemini models to work with createDeepAgent?**

```typescript
createDeepAgent({
    model: 'google_genai:gemini-3-flash-preview',
    systemPrompt: buildSystemPrompt(config.utcISODate),
    tools: asDeepAgentTools(campaignTools),
  });
};

```

This code snippet is my setup, in my env vars I have `GOOGLE_API_KEY` setup properly and I am using the Google Gen AI API and not Google Vertex AI for context.

When the model is `anthropic:claude-sonnet-4-20250514` and I have the `ANTHROPIC_API_KEY` this works fine. But for Gemini models for some reason this does not work and I get the following error when invoking the agent:

```auto
Unable to infer model provider for { model: google_genai:gemini-3-flash-preview }, please specify modelProvider directly.

```

For added context here are my `package.json` dependencies in case it’s to do with package versions:

```auto
"@langchain/community": "^1.0.0",
    "@langchain/core": "^1.0.6",
    "@langchain/google-genai": "^1.0.3",
    "@langchain/google-webauth": "^1.0.3",
    "@langchain/langgraph": "^1.0.0",
    "@langchain/openai": "^1.0.3",
    "countries-list": "^3.1.1",
    "deepagents": "^1.5.0",
    "langchain": "^1.0.6",
    "langsmith": "^0.3.80",
    "zod": "^3.24.1"

```

Appreciate any help 🙂

---

<div class="post-metadata">

### Author: ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)
#### Post date: [January 20, 2026, 11:50am UTC](https://forum.langchain.com/t/help-how-to-use-google-gemini-models-with-createdeepagent/2760/2 "2026-01-20T11:50:54Z")

</div>

hi @sa64r

try this:

```ts
createDeepAgent({
  model: "google-genai:gemini-3-flash-preview",
  systemPrompt: buildSystemPrompt(config.utcISODate),
  tools: asDeepAgentTools(campaignTools),
});

```
