Access Gemini models through the Google AI integration.
Setup
Add Provider
mixtrain provider add googleOr via SDK:
from mixtrain import MixClient
client = MixClient()
client.create_model_provider(
provider_type="google",
secrets={"api_key": "..."}
)Once added, Google models are available via mixtrain model catalog.
Usage
from mixtrain import get_model
model = get_model("gemini-pro")
result = model.run({
"prompt": "Explain the solar system",
"max_tokens": 1024
})Available Models
| Model ID | Description |
|---|---|
gemini-pro | Best for text generation |
gemini-pro-vision | Multimodal (text + images) |
gemini-ultra | Most capable model |
Configuration Options
| Parameter | Description |
|---|---|
max_tokens | Maximum tokens to generate |
temperature | Sampling temperature |
top_p | Nucleus sampling parameter |
top_k | Top-k sampling parameter |
Getting an API Key
- Go to makersuite.google.com
- Create or select a project
- Generate an API key
- Add it to Mixtrain using the setup steps above