flex_ai
0.42
Twitter (aka x)
from flex_ai import FlexAI
from openai import OpenAI
import time
# Initialize the Flex AI client
client = FlexAI ( api_key = "your_api_key_here" )
# Create dataset - for all datasets [here](https://docs.getflex.ai/quickstart#upload-your-first-dataset)
dataset = client . create_dataset (
"API Dataset New" ,
"instruction/train.jsonl" ,
"instruction/eval.jsonl"
)
# Start a fine-tuning task
task = client . create_finetune (
name = "My Task New" ,
dataset_id = dataset [ "id" ],
model = "meta-llama/Llama-3.2-1B-Instruct" ,
n_epochs = 5 ,
train_with_lora = True ,
lora_config = {
"lora_r" : 64 ,
"lora_alpha" : 8 ,
"lora_dropout" : 0.1
},
n_checkpoints_and_evaluations_per_epoch = 1 ,
batch_size = 4 ,
learning_rate = 0.0001 ,
save_only_best_checkpoint = True
)
# Wait for training completion
client . wait_for_task_completion ( task_id = task [ "id" ])
# Wait for last checkpoint to be uploaded
while True :
checkpoints = client . get_task_checkpoints ( task_id = task [ "id" ])
if checkpoints and checkpoints [ - 1 ][ "stage" ] == "FINISHED" :
last_checkpoint = checkpoints [ - 1 ]
checkpoint_list = [{
"id" : last_checkpoint [ "id" ],
"name" : "step_" + str ( last_checkpoint [ "step" ])
}]
break
time . sleep ( 10 ) # Wait 10 seconds before checking again
# Create endpoint
endpoint_id = client . create_multi_lora_endpoint (
name = "My Endpoint New" ,
lora_checkpoints = checkpoints_list ,
compute = "A100-40GB"
)
endpoint = client . wait_for_endpoint_ready ( endpoint_id = endpoint_id )
# Use the model
openai_client = OpenAI (
api_key = "your_api_key_here" ,
base_url = f" { endpoint [ 'url' ] } /v1"
)
completion = openai_client . completions . create (
model = "meta-llama/Llama-3.2-1B-Instruct" ,
prompt = "Translate the following English text to French" ,
max_tokens = 60
)
print ( completion . choices [ 0 ]. text )Ce tableau donne un aperçu des modèles de grande langue (LLMS) disponibles pour le réglage fin, commandé approximativement du plus connu au moins familier. Il répertorie les détails clés de chaque modèle, y compris son nom, sa famille, son nombre de paramètres, sa longueur de contexte et ses fonctionnalités supplémentaires.
| Nom du modèle | Famille | Paramètres (b) | Durée du contexte | Support VllM | Support Lora |
|---|---|---|---|---|---|
| Nvidia-Llama-3.1-Nemotron-70B-Istruct-HF | lama3.1 | 70 | 131 072 | Oui | Oui |
| Méta-llama-3.2-3b-instruct | lama3.2 | 3 | 131 072 | Oui | Oui |
| Méta-llama-3.2-1b-instruit | lama3.2 | 1 | 131 072 | Oui | Oui |
| Mistral-Small-Istruct-2409 | mistral | 7.2 | 128 000 | Oui | Oui |
| Ministral-8B-Istruct-2410 | mistral | 8 | 128 000 | Oui | Oui |
| Mathstral-7b-V0.1 | mistral | 7 | 32 000 | Oui | Oui |
| Qwen2.5-coder-7b-instruct | qwen2.5 | 7 | 32 768 | Oui | Oui |
| Aya-Expanse-32b | aya | 32 | 128 000 | Oui | Non |
| Aya-Expanse-8b | aya | 8 | 8 000 | Oui | Non |
| Nemotron-MinI-4B-Istruct | Nemotron | 4 | 4 096 | Oui | Non |
| Gemma-2-2b-it | gemma2 | 2 | 8,192 | Oui | Oui |
| Meta-Llama-3.1-70B-Instruct | lama3.1 | 70 | 131 072 | Oui | Oui |
| Meta-Llama-3.1-70B-Instruct | lama3.1 | 70 | 131 072 | Oui | Oui |
| Méta-llama-3.1-70b | lama3.1 | 70 | 131 072 | Oui | Oui |
| Méta-llama-3.1-8b-instruct | lama3.1 | 8 | 131 072 | Oui | Oui |
| Méta-llama-3.1-8b | lama3.1 | 8 | 131 072 | Oui | Oui |
| Méta-llama-3-70b-instruit | lama3 | 70 | 8,192 | Oui | Oui |
| Méta-llama-3-70b | lama3 | 70 | 8,192 | Oui | Oui |
| Méta-llama-3-8b-instruit | lama3 | 8 | 8,192 | Oui | Oui |
| Méta-llama-3-8b | lama3 | 8 | 8,192 | Oui | Oui |
| Mixtral-8x7b-instruct-v0.1 | mixtral | 46.7 | 32 768 | Oui | Oui |
| Mistral-7B-Instruct-V0.3 | mistral | 7.2 | 32 768 | Oui | Oui |
| Mistral-Nemo-Instruct-2407 | mistral | 12.2 | 128 000 | Non | Non |
| Mistral-Nemo-Base-2407 | mistral | 12.2 | 128 000 | Non | Non |
| Gemma-2-27b-it | gemma2 | 27 | 8,192 | Oui | Oui |
| Gemma-2-27b | gemma2 | 27 | 8,192 | Oui | Oui |
| Gemma-2-9b-it | gemma2 | 9 | 8,192 | Oui | Oui |
| Gemma-2-9b | gemma2 | 9 | 8,192 | Oui | Oui |
| PHI-3-Medium-128K-Istruct | phi3 | 14 | 128 000 | Oui | Non |
| PHI-3-Medium-4K-Istruct | phi3 | 14 | 4 000 | Oui | Non |
| PHI-3-SMALL-128K-INSTRUCT | phi3 | 7.4 | 128 000 | Oui | Non |
| PHI-3-Small-8k-Istruct | phi3 | 7.4 | 8 000 | Oui | Non |
| PHI-3-MINI-128K-INSTRUCTION | phi3 | 3.8 | 128 000 | Oui | Non |
| PHI-3-MINI-4K-INSTRUCT | phi3 | 3.8 | 4 096 | Oui | Non |
| QWEN2-72B-INSTRUCT | qwen2 | 72 | 32 768 | Oui | Oui |
| QWEN2-72B | qwen2 | 72 | 32 768 | Oui | Oui |
| QWEN2-57B-A14B-INSTRUCT | qwen2 | 57 | 32 768 | Oui | Oui |
| QWEN2-57B-A14B | qwen2 | 57 | 32 768 | Oui | Oui |
| QWEN2-7B-INSTRUCT | qwen2 | 7 | 32 768 | Oui | Oui |
| Qwen2-7b | qwen2 | 7 | 32 768 | Oui | Oui |
| QWEN2-1.5B-INSTRUCT | qwen2 | 1.5 | 32 768 | Oui | Oui |
| Qwen2-1.5b | qwen2 | 1.5 | 32 768 | Oui | Oui |
| QWEN2-0.5B-INSTRUCT | qwen2 | 0,5 | 32 768 | Oui | Oui |
| QWEN2-0.5B | qwen2 | 0,5 | 32 768 | Oui | Oui |
| Tinyllama_v1.1 | minuscule | 1.1 | 2 048 | Non | Non |
| Coder profonde-v2-lite-base | coder profonde-v2 | 16 | 163 840 | Non | Non |
| Interlm2_5-7b-chat | interlm2.5 | 7.74 | 1 000 000 | Oui | Non |
| Interlm2_5-7b | interlm2.5 | 7.74 | 1 000 000 | Oui | Non |
| Jamba-V0.1 | Jamba | 51.6 | 256 000 | Oui | Oui |
| Yi-1.5-34b-chat | yi-1,5 | 34.4 | 4 000 | Oui | Oui |
| Yi-1.5-34b | yi-1,5 | 34.4 | 4 000 | Oui | Oui |
| Yi-1.5-34b-32k | yi-1,5 | 34.4 | 32 000 | Oui | Oui |
| Yi-1.5-34b-chat-16k | yi-1,5 | 34.4 | 16 000 | Oui | Oui |
| Yi-1.5-9b-chat | yi-1,5 | 8.83 | 4 000 | Oui | Oui |
| Yi-1.5-9b | yi-1,5 | 8.83 | 4 000 | Oui | Oui |
| Yi-1.5-9b-32k | yi-1,5 | 8.83 | 32 000 | Oui | Oui |
| Yi-1.5-9b-chat-16k | yi-1,5 | 8.83 | 16 000 | Oui | Oui |
| Yi-1.5-6b-chat | yi-1,5 | 6 | 4 000 | Oui | Oui |
| Yi-1.5-6b | yi-1,5 | 6 | 4 000 | Oui | Oui |
| C4ai-Command-R-V01 | Command-R | 35 | 131 072 | Oui | Non |
Ce tableau fournit un aperçu complet des modèles disponibles, de leurs tailles, capacités et support pour diverses techniques de réglage fin. Lorsque vous choisissez un modèle de réglage fin, considérez des facteurs tels que la taille du modèle, la longueur du contexte et le support pour des techniques d'optimisation spécifiques comme VLLM et LORA.