Flex AI client library
Project description
FlexAI
A platform that simplifies fine-tuning and inference for 60+ open-source LLMs through a single API interface. FlexAI enables serverless deployment, reducing setup time by up to 70%.
Key Features
- Serverless fine-tuning and inference
- Live time and cost estimations
- Checkpoint management
- LoRA and multi-LoRA support
- Target inference validations
- OpenAI-compatible Endpoints API
- Interactive Playground
Installation
pip install flex_ai openai
Quick Start
from flex_ai import FlexAI
# Initialize client with your API key
client = FlexAI(api_key="your-api-key")
# Create dataset
dataset = client.create_dataset("Dataset Name", "train.jsonl", "eval.jsonl")
# Start fine-tuning
task = client.create_finetune(
name="My Task",
dataset_id=dataset["id"],
model="meta-llama/Llama-3.2-3B-Instruct",
n_epochs=10,
train_with_lora=True,
lora_config={
"lora_r": 64,
"lora_alpha": 8,
"lora_dropout": 0.1
}
)
# Create endpoint
endpoint = client.create_multi_lora_endpoint(
name="My Endpoint",
lora_checkpoints=[{"id": checkpoint_id, "name": "step_1"}],
compute="A100-40GB"
)
Using Your Fine-tuned Model
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url=f"{endpoint_url}/v1"
)
completion = client.completions.create(
model="your-model",
prompt="Your prompt",
max_tokens=60
)
Get Started
- Sign up at app.getflex.ai
- Get your API key from Settings -> API Keys
- Start with our documentation
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flex_ai-0.39.tar.gz
(13.6 kB
view details)
Built Distribution
flex_ai-0.39-py3-none-any.whl
(18.6 kB
view details)
File details
Details for the file flex_ai-0.39.tar.gz
.
File metadata
- Download URL: flex_ai-0.39.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89669570cd90f0ffc8f7911d1f71deb712acc903e6c950b792fc8121709d2d09 |
|
MD5 | df57ad178777f091a3594660444b819c |
|
BLAKE2b-256 | 9f0cfab9ab6d039a0db1e1d9af41983b4af1fb9bb62e6058640c780864878571 |
File details
Details for the file flex_ai-0.39-py3-none-any.whl
.
File metadata
- Download URL: flex_ai-0.39-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fbdb7a5131366f1f28cacc419d05fdbc36809e15816988abcf974fd2ec317fc |
|
MD5 | 570b41aa0ed4b7d44137d0f79729238d |
|
BLAKE2b-256 | b94554ba2465371ba1772706216cb7d7cfebb52fdb2d0ebba126568d5fcf6cd2 |