### Scaling Strategy Examples (HTML)
Source: https://docs.simplismart.ai/troubleshooting-faq/model-deployment-troubleshooting
Provides example configurations for scaling strategies in Simplismart Cloud. These examples illustrate how to set minimum and maximum pod counts, along with the chosen metric and threshold, for different use cases like aggressive scaling or latency-sensitive applications.
```html
theme={null}
# Aggressive Scaling (Variable Traffic)
Min Pods: 1
Max Pods: 20
Metric: GPU Utilisation
Threshold: 60%
# Latency-Sensitive Scaling
Min Pods: 3
Max Pods: 15
Metric: Latency
Threshold: 300ms
```
--------------------------------
### Deployment Name Examples (HTML)
Source: https://docs.simplismart.ai/troubleshooting-faq/model-deployment-troubleshooting
Illustrates recommended and discouraged naming conventions for model deployments. These examples help users adhere to the platform's requirements for unique and descriptive deployment names, avoiding common pitfalls like generic or improperly formatted names.
```html
theme={null}
✅ Good Examples:
- llama-3b-dev-v2
- gemma-7b-production
- mistral-8b-api-staging
❌ Avoid:
- model1, model2 (not descriptive)
- test (too generic)
- prod.model (special characters)
```
--------------------------------
### Complete JSONL Training Example
Source: https://docs.simplismart.ai/training-suite/vlms/grpo-vlm
Presents a complete example of a training entry in the JSONL format. It includes a prompt with image and text content, an image path, and an answer. This example demonstrates how all the components fit together in a single data point.
```json
[
{
"prompt": [
{
"role": "user",
"content": [
{ "type": "image" },
{
"type": "text",
"text": (
"When a spring does work on an object, … provide your reasoning between and "
"and then your final answer between and (put a float here) "
)
}
]
}
],
"image": "images/cumin_canister_spring.jpg",
"answer": "1.2"
}
]
```
--------------------------------
### Complete Example: Prompt with Reasoning and Answer Tags
Source: https://docs.simplismart.ai/training-suite/llms/grpo-llm
Provides a full example of a dataset entry, demonstrating a multi-turn prompt structure (though shown as single-turn here) and a string answer.
```json
train_dataset = [
{
"prompt": [
{
"role": "user",
"content": "When a spring does work on an object, … provide your reasoning between and and then your final answer between and (put a float here) "
}],
"answer": "1.2",
},
]
```
--------------------------------
### Example JSONL Data Snippet
Source: https://docs.simplismart.ai/training-suite/vlms/grpo-vlm
Illustrates a snippet of data from a JSONL file containing prompts, image paths, and answers. This example shows how multiple entries would be formatted within the file. Each line represents a single training example for the VLM.
```json
{"prompt": "...","image": "...","answer": "..."}
{"prompt": "...","image": "...","answer": "..."}
{"prompt": "...","image": "...","answer": "..."}
{"prompt": "...","image": "...","answer": "..."}
```
--------------------------------
### Complete ECD Model Configuration Example
Source: https://docs.simplismart.ai/training-suite/ecd/create-ecd-training
A full configuration example for an ECD model, suitable for binary classification tasks. It includes trainer settings, preprocessing steps, combiner details, input/output features, and loss function configuration.
```json
{
"model_type": "ecd",
"infra_type": "gpu",
"trainer": {
"early_stop": 5,
"decay": true,
"batch_size": 512,
"epochs": 50,
"optimizer": {
"type": "adam"
},
"decay_rate": 0.8,
"decay_steps": 20000,
"learning_rate": 0.02,
"validation_field": "target",
"validation_metric": "roc_auc",
"learning_rate_scaling": "sqrt"
},
"preprocessing": {
"sample_ratio": 0.01,
"sample_size": null,
"oversample_minority": null,
"undersample_majority": null,
"global_max_sequence_length": null,
"split": {
"type": "stratify",
"column": "target",
"probabilities": [0.8, 0.1, 0.1]
}
},
"combiner": {
"type": "tabnet",
"size": 64,
"output_size": 64,
"num_steps": 4,
"num_total_blocks": 4,
"num_shared_blocks": 2,
"relaxation_factor": 1.3,
"bn_epsilon": 0.001,
"bn_momentum": 0.98,
"bn_virtual_bs": 128,
"sparsity": 0.001,
"dropout": 0
},
"input_features": [
{
"name": "input_1",
"type": "category",
"column": "input_1"
},
{
"name": "input_2",
"type": "text",
"column": "input_2"
}
],
"output_features": [
{
"name": "target",
"type": "binary",
"column": "target",
"loss": {
"type": "binary_weighted_cross_entropy",
"class_weights": {
"0": 0.66,
"1": 2
},
"weight": 1
}
}
]
}
```
--------------------------------
### Project Dependencies and Environment Setup (YAML)
Source: https://docs.simplismart.ai/model-suite/adding-a-custom-model
Specifies the Python version, environment variables, and required Python packages for the project. It also lists system packages and a custom setup script for environment configuration.
```yaml
python_version: "3.10"
environment_variables: {}
requirements:
- accelerate==0.20.3
- bitsandbytes==0.39.1
- peft==0.3.0
- protobuf==4.23.3
- sentencepiece==0.1.99
- torch==2.0.1
- transformers==4.30.2
system_packages:
- wget
- curl
custom_setup_script: "script.sh"
```
--------------------------------
### TabNet Combiner Configuration Example
Source: https://docs.simplismart.ai/training-suite/ecd/create-ecd-training
An example configuration for the TabNet combiner, which merges features using the TabNet architecture. It includes parameters for network size, attention steps, and regularization.
```json
"combiner": {
"type": "tabnet",
"size": 64,
"output_size": 64,
"num_steps": 4,
"num_total_blocks": 4,
"num_shared_blocks": 2,
"relaxation_factor": 1.3,
"bn_epsilon": 0.001,
"bn_momentum": 0.98,
"bn_virtual_bs": 128,
"sparsity": 0.001,
"dropout": 0
}
```
--------------------------------
### Install OpenAI Python Client
Source: https://docs.simplismart.ai/quickstart/inference
Installs the necessary Python client library for interacting with OpenAI's API. This is a prerequisite for running Python scripts that make API calls.
```shell
pip install openai
```
--------------------------------
### Input Feature Configuration Example
Source: https://docs.simplismart.ai/training-suite/ecd/create-ecd-training
An example of how to configure input features for the ECD model. This specifies the feature's name, type (e.g., 'category', 'numerical'), and the corresponding column name in the dataset.
```json
"input_features": [
{
"name": "device_name",
"type": "category",
"column": "device_name"
},
{
"name": "hour_sin",
"type": "numerical",
"column": "hour_sin"
}
]
```
--------------------------------
### Output Feature Configuration Example
Source: https://docs.simplismart.ai/training-suite/ecd/create-ecd-training
Example configuration for output features, demonstrating a binary classification output with custom weighted cross-entropy loss. It specifies the loss function, its parameters, the output name, type, and corresponding dataset column.
```json
"output_features": [
{
"loss": {
"type": "binary_weighted_cross_entropy",
"weight": 1,
"class_weights": {
"0": 0.66,
"1": 2
}
},
"name": "target",
"type": "binary",
"column": "target"
}
]
```
--------------------------------
### Example JSONL File Structure for DPO Training
Source: https://docs.simplismart.ai/training-suite/llms/dpo-llm
Illustrates the structure of a JSON Lines (JSONL) file used for DPO fine-tuning. Each line in the file represents a complete training example, adhering to the OpenAI DPO JSON format. This format allows for efficient processing of large datasets.
```jsonl
{"messages": [{"role": "...", "content": "..."},], "rejected_response": "..."}
{"messages": [{"role": "...", "content": "..."},], "rejected_response": "..."}
{"messages": [{"role": "...", "content": "..."},], "rejected_response": "..."}
```
--------------------------------
### Whisper API Authentication Setup
Source: https://docs.simplismart.ai/guides/whisper-deployment-guide
Demonstrates how to set up authentication for the Whisper API using a Bearer token. The JWT token should be included in the 'Authorization' header of your requests.
```json
headers = {"Authorization": "Bearer YOUR_JWT_TOKEN"}
```
--------------------------------
### Whisper API Request with Audio URL
Source: https://docs.simplismart.ai/guides/whisper-deployment-guide
Example Python code for sending a transcription or translation request to the Whisper API using a publicly accessible audio URL. This demonstrates how to specify the audio source via a URL and configure various processing parameters.
```python
import requests
import json
# API request with URL
headers = {"Authorization": "Bearer YOUR_JWT_TOKEN"}
payload = {
"audio_file": "https://example.com/audio.mp3", # Publicly accessible audio URL
"language": "en", # English audio
"task": "transcribe", # Transcribe in same language
"vad_model": "silero", # Use Silero VAD
"word_timestamps": True, # Include word timestamps
"without_timestamps": False, # Keep timestamps in text
"diarization": False, # Single speaker
"vad_onset": 0.5, # Speech detection threshold
"vad_offset": 0.3, # Speech end threshold
"strict_hallucination_reduction": True # Reduce false content
}
response = requests.post(
"/predict",
json=payload,
headers=headers
)
```
--------------------------------
### Whisper API Request with Base64 Audio
Source: https://docs.simplismart.ai/guides/whisper-deployment-guide
Example Python code for sending a transcription or translation request to the Whisper API using Base64 encoded audio data. It includes essential parameters like audio file, language, task, VAD settings, and optional features like diarization and hallucination reduction.
```python
import requests
import base64
import json
# Read and encode audio file
with open("audio_file.mp3", "rb") as f:
audio_data = f.read()
audio_base64 = base64.b64encode(audio_data).decode("utf-8")
# API request with base64
headers = {"Authorization": "Bearer YOUR_JWT_TOKEN"}
payload = {
"audio_file": audio_base64, # Base64-encoded audio data
"language": "hi", # Hindi audio
"task": "translate", # Translate to English
"vad_model": "silero", # Use Silero VAD
"word_timestamps": True, # Include word timestamps
"without_timestamps": False, # Keep timestamps in text
"diarization": True, # Identify speakers
"vad_onset": 0.5, # Speech detection threshold
"vad_offset": 0.3, # Speech end threshold
"strict_hallucination_reduction": True # Reduce false content
}
response = requests.post(
"/predict",
json=payload,
headers=headers
)
```
--------------------------------
### POST /api/flux/train/
Source: https://docs.simplismart.ai/api-reference/training/flux/start-a-new-flux-training-job
Submit a new Flux training job with the specified configuration, training data, and metadata.
```APIDOC
## POST /api/flux/train/
### Description
Submit a new Flux training job with the specified configuration, training data, and metadata.
### Method
POST
### Endpoint
https://training-suite.simplismart.ai/api/flux/train/
### Parameters
#### Header Parameters
- **Authorization** (string) - Required - Bearer token for authentication and authorization.
#### Request Body
- **trigger_word** (string) - Required - The trigger word to be associated with generated images.
- **rank** (string) - Optional - The rank parameter for training.
- **steps** (string) - Optional - Number of training steps.
- **lr** (string) - Optional - Learning rate for training.
- **optimizers** (string) - Optional - Optimizer to use for training.
- **high_resolution_mode** (string) - Optional - Whether to enable high resolution mode.
- **org** (string) - Required - Organization ID associated with the training job.
- **dataset_file** (file) - Required - Dataset file containing training images.
- **name** (string) - Required - Name assigned to the Flux training job.
### Request Example
```json
{
"trigger_word": "portrait of a person",
"rank": "128",
"steps": "1000",
"lr": "0.0001",
"optimizers": "Adam",
"high_resolution_mode": "false",
"org": "0bf00b43-430a-4ca3-a8b3-b13cc8dc6d4d",
"dataset_file": "",
"name": "my_first_flux_job"
}
```
### Response
#### Success Response (200)
- **lora_id** (string) - Unique identifier for the Flux training job
- **status** (string) - Initial status of the training job
- **message** (string) - Additional information about the job submission
#### Response Example
```json
{
"lora_id": "",
"status": "",
"message": ""
}
```
```
--------------------------------
### Example JSONL File Content
Source: https://docs.simplismart.ai/training-suite/llms/grpo-llm
Illustrates the content of a JSON Lines (`.jsonl`) file used for LLM training, showing multiple prompt-answer pairs.
```json
{"prompt": "...","answer": "..."}
{"prompt": "...","answer": "..."}
{"prompt": "...","answer": "..."}
{"prompt": "...","answer": "..."}
```
--------------------------------
### LLM Training Configuration with Quantization
Source: https://docs.simplismart.ai/configurations/llm-training-configuration
This JSON configuration defines parameters for LLM training, including input and output features, quantization settings (like bits, thresholds, and data types), and trainer configurations. It specifies preprocessing steps and the backend type for training. Ensure input/output feature names match dataset columns.
```json
{
"input_features": [
{
"name": "question",
"type": "text",
"preprocessing": {
"max_sequence_length": 4096
}
}
],
"output_features": [
{
"name": "answer",
"type": "text",
"preprocessing": {
"max_sequence_length": 4096
}
}
],
"quantization": {
"bits": 4,
"llm_int8_threshold": 6,
"llm_int8_has_fp16_weight": false,
"bnb_4bit_compute_dtype": "float16",
"bnb_4bit_use_double_quant": true,
"bnb_4bit_quant_type": "nf4"
},
"trainer": {
"type": "finetune",
"learning_rate_scheduler": {
"warmup_fraction": 0.01,
"decay": "linear"
}
},
"preprocessing": {
"sample_ratio": 1
},
"backend": {
"type": "local"
}
}
```