Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Lumino SDK for Python

Static Badge X (formerly Twitter) Follow

The Lumino SDK for Python provides a convenient way to interact with the Lumino API for managing large language model (LLM) fine-tuning processes and related resources.

Features

  • User management
  • API key management
  • Dataset operations
  • Fine-tuning job management
  • Model information retrieval
  • Usage tracking

Installation

You can install the Lumino SDK using pip:

pip install lumino-api-sdk-python

Setting up API Key

Generate an API key by visiting the Lumino Dashboard at this settings page.

Setting environment variable

export LUMSDK_API_KEY=xxxxx

Usage – Python Client

User Management

import os
import asyncio
from lumino.api_sdk.sdk import LuminoSDK


async def main():
    async with LuminoSDK(os.environ.get("LUMSDK_API_KEY")) as client:
        user = await client.user.get_current_user()
        print(user)


asyncio.run(main())

Datasets

The files API is used for fine-tuning and allows developers to upload data to fine-tune on. It also has several methods to list all files, retrive files, and delete files. Please refer to our fine-tuning docs here.

import asyncio
import os

from lumino.api_sdk.sdk import LuminoSDK


async def main():
    async with LuminoSDK(os.environ.get("LUMSDK_API_KEY")) as client:
        files = await client.dataset.list_datasets()
        await client.dataset.upload_dataset("somefile.jsonl")
        await client.dataset.get_dataset("somefile.jsonl")
        await client.dataset.delete("somefile.jsonl")

        print(files)


asyncio.run(main())

Models

This lists all the models that Lumino supports.

import os
import asyncio
from lumino.api_sdk.sdk import LuminoSDK


async def main():
    async with LuminoSDK(os.environ.get("LUMSDK_API_KEY")) as client:
        models = await client.model.list_base_models()
        print(models)


asyncio.run(main())

Fine-tunes

The finetune API is used for fine-tuning and allows developers to create finetuning jobs. It also has several methods to list all jobs, retrive statuses and get checkpoints. Please refer to our fine-tuning docs here.

import os
import asyncio
from lumino.api_sdk.sdk import LuminoSDK
from lumino.api_sdk.models import FineTuningJobCreate, FineTuningJobParameters


async def main():
    async with LuminoSDK(os.environ.get("LUMSDK_API_KEY")) as client:
        files = await client.dataset.list_datasets()
        job = await client.fine_tuning.create_fine_tuning_job(FineTuningJobCreate(
            base_model_name="llm_llama3_1_8b",
            dataset_name=files[0].name,
            name="test-fine-tuning-job",
            parameters=FineTuningJobParameters(
                batch_size=2,
                shuffle=True,
                num_epochs=1,
                use_lora=True,
                use_qlora=False
            )
        ))

        print(job)

        jobs = await client.fine_tuning.list_fine_tuning_jobs()
        print(jobs)

        job_details = await client.fine_tuning.get_fine_tuning_job(job.name)
        print(job_details)


asyncio.run(main())

Usage Tracking

import os
import asyncio
from lumino.api_sdk.sdk import LuminoSDK
from datetime import timedelta, date


async def main():
    async with LuminoSDK(os.environ.get("LUMSDK_API_KEY")) as client:
        end_date = date.today()
        start_date = end_date - timedelta(days=30)
        total_cost = await client.usage.get_total_cost(start_date, end_date)
        print(total_cost)

        usage_records = await client.usage.list_usage_records(start_date, end_date)
        print(usage_records)


asyncio.run(main())

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

Metadata

Release files for lumino-api-sdk-python 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumino-api-sdk-python 0.11.1
File Size Uploaded Provenance Actions
lumino_api_sdk_python-0.11.1.tar.gz 17.5 kB Without provenance Details for lumino_api_sdk_python-0.11.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lumino-api-sdk-python 0.11.1
File Interpreter ABI Platform Actions
lumino_api_sdk_python-0.11.1-py3-none-any.whl Python 3 none any Details for lumino_api_sdk_python-0.11.1-py3-none-any.whl

Total release size: 33.2 kB

Release files / lumino_api_sdk_python-0.11.1.tar.gz

Download URL lumino_api_sdk_python-0.11.1.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
095d14b0ca3329385f3d91365f2a7fb62f2afbbe25ae12c95847664d3eb616f1
BLAKE2b-256 checksum
How to use checksums
adff231c2061136df1c9cfbf9e35fe75025f7c5c035877613d47c07278740881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / lumino_api_sdk_python-0.11.1-py3-none-any.whl

Download URL lumino_api_sdk_python-0.11.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
277017230950ff62454f55e8925a009f72df9e296d88636f26e9ebf28199d0fd
BLAKE2b-256 checksum
How to use checksums
08135fbe462f821cdb64c5923623a1087cb7a3cb6e285c00faea8ff27048025d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Security for lumino-api-sdk-python 0.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page