Skip to main content

Takeoff SDK package is a python sdk that provides a simple interface to interact with Takeoff

Project description

Takeoff SDK - Internal

Table of Contents

About

The Takeoff SDK library facilitates launching Takeoff within Python. It provides a Pythonic interface, simplifying the process of initiating Takeoff using the docker run command. Essentially, it wraps the dev.sh script, which manages Docker with all necessary environment variables, volume mounting, network configuration, and device settings. This library is specifically designed for an internal team of developers who need to integrate Python applications with the Takeoff Server, offering a quick and straightforward way to start Takeoff in a Python runtime. It also enables running benchmarks and integration tests.

Getting Started

Installing

To get started with the Takeoff SDK Library, you can install it directly using pip:

pip install takeoff_sdk

Alternatively, if you are working on developing the library, you can install it in editable mode. This allows you to make changes to the library and test them in real-time. Navigate to the takeoff-sdk folder and run the following command:

pip install -e . 

Usage

Launch Takeoff

To quickly launch the Takeoff server with default configurations, use the following script:

from takeoff_sdk import Takeoff

takeoff = Takeoff(model_name="test_model", device="cuda")
takeoff.start() # this will start a docker with takeoff server in the background

For a more customized setup:

from takeoff_sdk import Takeoff, TakeoffEnvSetting
config = TakeoffEnvSetting(model_name="test_model", device="cpu", max_batch_size=16)
takeoff = Takeoff.from_config(config)
takeoff.start() # this will start a docker with takeoff server in the background

Refer to the TakeoffEnvSetting Data Object or Takeoff Environment Variables Settings for additional configuration options.

Add Extra Model

This utilizes the model_management_api functionality, which in python you can do:

# assume you have a takeoff object running
# takeoff.start() running

 # This will add one more model to `embedding` consumer group
takeoff.add_model(model_name="test_model", backend="hf", device="cuda", consumer_group="embedding")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

takeoff_sdk-0.0.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

takeoff_sdk-0.0.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file takeoff_sdk-0.0.2.tar.gz.

File metadata

  • Download URL: takeoff_sdk-0.0.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for takeoff_sdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2c048a4f6250980cea753243b56670b79034f9aacd05b0e947f489b7e1f2f1ad
MD5 d6c6c92089796075f96567f92b57a147
BLAKE2b-256 5ee269202f25a27fc7a87ec2bf2dd40f7b6924aba01f7f1b03f83b555d1bcae3

See more details on using hashes here.

File details

Details for the file takeoff_sdk-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: takeoff_sdk-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for takeoff_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e88b1ba24f2cc323096c1b88f0f1797cddfc84b2d831f27ffbc31c7a03f06f8b
MD5 842060dcd0a2e0bb9587c97b98e3defa
BLAKE2b-256 89a1b23ccfe4ad15374d7b56e75617da5e3f29729c66a524fb6bb4a02c7b8973

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page