Skip to content

Commit 540772d

Browse files
Add gemini to LM provider (#8417)
1 parent 706799f commit 540772d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ Instead of wrangling prompts or training jobs, DSPy (Declarative Self-improving
5353
dspy.configure(lm=lm)
5454
```
5555

56+
=== "Gemini"
57+
You can authenticate by setting the GEMINI_API_KEY env variable or passing `api_key` below.
58+
59+
```python linenums="1"
60+
import dspy
61+
lm = dspy.LM('gemini/gemini-2.5-flash', api_key='YOUR_GEMINI_API_KEY')
62+
dspy.configure(lm=lm)
63+
```
64+
5665
=== "Local LMs on your laptop"
5766
First, install [Ollama](https://github.com/ollama/ollama) and launch its server with your LM.
5867

0 commit comments

Comments
 (0)