Me
How to configure ML models?
Enki
# Configuring ML Models in Game Server
There are two main types of ML models you can configure in Game Server:
## 1. Embedded ML Models
Embedded ML models are client-downloadable models that run locally on the device.
### Creating an Embedded ML Model
1. Navigate to **ML: Embedded ML models** and click **[+New]**
2. Fill in the **Name** field with a unique name
3. Add **Labels** (optional tags to group/find models)
4. Fill in the required Settings:
- **Model file URL** - Location of the model file
- **Feature service key** - Tells the backend which feature service to use
5. Click **[Save]**
**Important:** The Feature service makes calls to the base URL configured in **Edit Application → Feast host endpoint**. If this endpoint is not set, feature lookup will fail. Set the host endpoint first, then provide the Feature service key.
### Using Embedded ML Models
Currently, Embedded ML models are used for **Ad Frequency** decisions:
- Navigate to **Game Server → Ads → Ads Config → Embedded ML Config**
- Select the Embedded ML model you created (or "None" to disable)
- When enabled, the model's output determines ad frequency on-device
- Setting it to "None" reverts to manual frequency restriction
---
## 2. Game-Specific 3rd-Party ML Models
These models use external inference endpoints and support both **Classic** and **Journey** types.
> **Note:** This feature is not available in all games. Confirm your application supports Game-Specific 3rd-Party ML models before proceeding.
### Creating a Game-Specific 3rd-Party ML Model
1. Navigate to **ML: ML models** and click **[+New]**
2. Fill in the **Name** with a unique name
3. Select **Type**: Choose between **Classic** or **Journey** (settings vary by type)
4. Add **Labels** (optional)
5. Add the **Endpoint** (required) - The HTTPS URL the server will call for predictions
6. Specify **Model request parameters** based on your model's capabilities:
| Setting | Classic | Journey | Description |
|---------|---------|---------|-------------|
| **Number of configs to return** | ✓ | ✓ | Integer count of configuration candidates to return |
| **ML for All Shapes Placeable enabled** | – | ✓ | Only return configs where all shapes are placeable |
| **ML for Perfect Fit enabled** | ✓ | ✓ | Request a "perfect-fit" option (tightest match) |
| **ML for Complementary fit enabled** | ✓ | ✓ | Request option complementing recent player behaviour |
| **ML for Terminator enabled** | ✓ | ✓ | Include fail-safe/"terminator" option to fall back to |
| **ML for Seeds** | ✓ | – | Return deterministic seed values (Classic only) |
| **ML for Figure sets** | ✓ | – | Return figure-set–aware configurations |
7. Click **[Save]**
### Selecting an ML Model in Game Settings
After creating your model, configure it in Game Server:
**Navigate to:** Game Server → Game Settings
| Block | Field | What it does | Notes |
|-------|-------|-------------|-------|
| Classic / Journey | **ML configuration ID** | Pick the ML Model you created. Enables ML on the client. | Select "None" to disable ML for this game |
| Classic | **Number of events for ML model** | How many recent Game End events the client sends for analysis | Must be a positive integer |
| Journey | **Max number of game end events for ML model** | Same as above, but for Journey flow | Must be a positive integer |
**Validation tips:**
- Setting ML configuration ID to "None" disables ML for the client
- Event count of 0 disables event sending
### End-to-End Flow
1. **Config to client** - Game Server sends the ML configuration
2. **Client collects events** - After the defined trigger (e.g., game win), the client sends the latest N Game End events
3. **Server → ML endpoint** - Game Server forwards events to your ML model's endpoint with configured parameters
4. **ML inference** - Your ML service returns results
5. **Results to client** - Game Server returns results, and the client applies the recommended configuration
---
## Managing Models
For both types of ML models, you can:
- **Edit** - Open a model, change fields, and save
- **Duplicate** - Create a copy from the list view
- **Delete** - Remove the configuration (cannot be undone; only do this if no client build depends on it)