MixtrainDocs

Access Gemini models through the Google AI integration.

Setup

Add Provider

mixtrain provider add google

Or 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 IDDescription
gemini-proBest for text generation
gemini-pro-visionMultimodal (text + images)
gemini-ultraMost capable model

Configuration Options

ParameterDescription
max_tokensMaximum tokens to generate
temperatureSampling temperature
top_pNucleus sampling parameter
top_kTop-k sampling parameter

Getting an API Key

  1. Go to makersuite.google.com
  2. Create or select a project
  3. Generate an API key
  4. Add it to Mixtrain using the setup steps above

On this page