Skip to main content

No project description provided

Project description

dat1-cli

A command line interface for the dat1 platform.

Installation

pip install dat1-cli

Usage

Initialize with your API key:

dat1 login

To initialize a new model project, run in the root directory of your project:

dat1 init

To upload your model to the platform:

dat1 deploy

A good starting point for your model is using the example model.

Otherwise, the platform expects a handler.py file in the root directory of your project that contains a FastAPI app with two endpoints: GET / for healthchecks and POST /infer for inference. An example handler is shown below:

from fastapi import Request, FastAPI
from vllm import LLM, SamplingParams
import os

llm = LLM(model=os.path.expanduser('./'), load_format="safetensors", enforce_eager=True)

app = FastAPI()

@app.get("/")
async def root():
    return "OK"

@app.post("/infer")
async def infer(request: Request):
    request = await request.json()
    prompts = request["prompt"]
    sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
    outputs = llm.generate(prompts, sampling_params)
    return { "response" : outputs[0].outputs[0].text }

Launching Locally

Pre-requisites

  • Docker
  • CUDA-compatible GPU
  • NVIDIA Container Toolkit

To launch your model locally, run:

dat1 serve

License

MIT

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

dat1_cli-0.0.8.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dat1_cli-0.0.8-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file dat1_cli-0.0.8.tar.gz.

File metadata

  • Download URL: dat1_cli-0.0.8.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dat1_cli-0.0.8.tar.gz
Algorithm Hash digest
SHA256 84b8f83561a08d033b00e60217223e732a1a2e185fd1f2be0782583075e70ee6
MD5 5d52a824f9d33c22bff8ef68038c5694
BLAKE2b-256 0688b0a95351f5cb9f1a7b0f584137fc22a7d99b2b3c55476d70700bbe053dc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dat1_cli-0.0.8.tar.gz:

Publisher: publish.yml on dat1-co/dat1-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dat1_cli-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: dat1_cli-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dat1_cli-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ccaea43aecf46b73e2ed75f87218f004606d2515976bb8c6ce76a929ba791f05
MD5 00fe54115e214ef54254c07699fcba17
BLAKE2b-256 4e22c689420a22fa91084b59153e37c01eb9c684d36f1dc8447c5a2445feab56

See more details on using hashes here.

Provenance

The following attestation bundles were made for dat1_cli-0.0.8-py3-none-any.whl:

Publisher: publish.yml on dat1-co/dat1-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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