semvec/pypi-packages huggingface dataset:
gpu-sentinel 0.1.4
Monitor idle GPU usage.
License: MIT
Requires Python: >=3.7
Keywords: gpu,monitor,utilization

# GPU Sentinel

*A Moonshine Labs tool*

## Overview
If you're automating training your large models in the cloud, cost control is critial. How many times have you accidentally left an expensive GPU instance running when the underlying job had crashed, costing you money or capacity with no benefit?

*GPU Sentinel* is a simple tool that will watch your instance and automatically trigger when GPU utilization drops below a certain amount for a period of time. GPU Sentinel can automatically shutdown or reboot the instance, or simply end its own process so you can do an action yourself.

## Installation
```
$ pip install gpu_sentinel
$ gpu_sentinel --help
```

## Usage
The GPU sentinel has two states, IDLE and ARMED.

When you start the program, it will wait for the GPU to be above a certain utilization for a set amount of time. Once this condition is met, the sentinel will be ARMED. This will let you set the sentinel at any point, and it will only trigger once the GPU has been running for a while.

Once ARMED, the sentinel will wait for the GPU utilization to drop below a certain threshold for a set amount of time. Once this condition is met, the `kill_action` will occur immediately.

Options:

```
arm_duration: How many seconds of activity to wait before arming the sentinel.
arm_threshold: What level of utilization is considered activity
kill_duration: How many seconds of inactivity to wait before running the kill function.
kill_threshold: What level of utilization is considered inactivity
kill_action: What to do when the kill trigger is hit {end_process,shutdown,reboot}
gpu_devices: Which GPU devices to average (empty for all)
```

## API
If you would prefer to use integrate this package into your own code, we provide a straightforward API to do so.

```python
from gpu_sentinel import Sentinel, get_gpu_usage

def my_callback_fn():
    print("Triggered!")
    exit()

# Create the sentinel that watches the values.
sentinel = Sentinel(
    arm_duration=10,
    arm_threshold=0.7,
    kill_duration=60,
    kill_threshold=0.7,
    kill_fn=my_callback_fn,
)

while True:
    # This is the averaged GPU usage of the devices.
    gpu_usage = get_gpu_usage(device_ids=[0, 1, 2, 3])
    # Add the GPU usage to the sentinel's next state.
    sentinel.tick(gpu_usage)
    # The sentinel operates on ticks, not seconds, so if we want to check every second
    # we must do the timer ourselves.
    time.sleep(1)
```

## Current Limitations

* To shutdown/reboot the machine, GPU Sentinel requires sudo permissions or sudo-less shutdown.
* Currently only working on Linux, can add Windows support if there's interest.
tictactoe-gpt-finetuning 0.1.3
Python tic tac toe state generator and GPT fine tuning
License: MIT
Keywords: tictactoe,llm,language-models

TicTacToe GPT Finetuning
========================

Simple python implementation of Tic Tac Toe.

Designed to make GPT able to recognize valid moves in Tic Tac Toe

::

   $ pip install tictactoe-gpt-finetuning

Examples
--------

Generate a game:

.. code:: python

    from tictactoe_gpt_finetuning import tictactoe
    print( tictactoe.generate_random_game() )

Generate many games:

.. code:: python

    from tictactoe_gpt_finetuning import tictactoe
    print( tictactoe.generate_n_games() )

Initialize and use the game board to place in top left:

.. code:: python

    from tictactoe_gpt_finetuning import tictactoe
    b = tictactoe.BoardState()
    b.make_move( 0, 0, 'x' )
    print( b )
    # output:
    # x - -
    # - - -
    # - - -

Train a Model
-------------

We can compare inputs to outputs of the model, and compare
predictions of the model before and after finetuning.

.. code:: python

    from tictactoe import Model, finetune, compare_tictactoe_predictions
    gpt = Model()

    # See what predictions look like before finetuning
    compare_tictactoe_predictions( gpt )

    # Fine-tune the model
    finetune( gpt, n_epochs=10 )

    # See what new predictions look like after finetuning
    compare_tictactoe_predictions
vastai-client 0.1.1
Python client for the Vast.ai cloud rent service.
License: MIT
Requires Python: >=3.7,<4.0

# vastai-client

[![Build Status](https://github.com/Barahlush/vastai-client/workflows/test/badge.svg?branch=master&event=push)](https://github.com/Barahlush/vastai-client/actions?query=workflow%3Atest)
[![Python Version](https://img.shields.io/pypi/pyversions/vastai-client.svg)](https://pypi.org/project/vastai-client/)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)

Python client for the Vast.ai cloud rent service. This package provides a Python client, that allows to list, create, destroy GPU instances programmaticaly, using Python.

There is an official Vast.ai [CLI](https://github.com/vast-ai/vast-python), however it can only be used through the command line.


## Installation

```bash
pip install vastai-client
```


## Example

With the package you can list offers and run selected machines:

```python
from vastai_client import VastClient

client = VastClient(api_key=<your_api_key>)
available_machines = client.search_offers(search_query='reliability > 0.98 num_gpus=1 gpu_name=RTX_3090', sort_order='dph-')
print(available_machines)

selected_machine = available_machines[0]
client.create_instance(id=selected_machine.id, image='pytorch/pytorch', ssh=True)
```

For more details, watch documentation.

## License

[MIT](https://github.com/Barahlush/vastai-client/blob/master/LICENSE)


## Credits

This project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [9899cb192f754a566da703614227e6d63227b933](https://github.com/wemake-services/wemake-python-package/tree/9899cb192f754a566da703614227e6d63227b933). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/9899cb192f754a566da703614227e6d63227b933...master) since then.
target-singer-jsonl 0.1.0
A Singer.io target for writing singer-formatted JSONL files to various destinations (e.g. local or s3).
License: MIT
Requires Python: >=3.10,<4.0
Keywords: ELT,Singer.io

# target-singer-jsonl

This is a [Singer](https://singer.io) target that reads JSON-formatted data following the [Singer spec](https://github.com/singer-io/getting-started/blob/master/SPEC.md) and writes it to JSONL formatted files.
File writing is done via the `smart_open` python package, supporting local disk as well as many other destinations (e.g. S3).
tap-singer-jsonl 0.1.0
A Singer.io tap fro reading raw singer-formatted JSONL files from local and remote sources (e.g. s3).
License: MIT
Requires Python: >=3.10,<3.12
Keywords: ELT,Singer.io

# tap-singer-jsonl

This is a [Singer](https://singer.io) tap that reads JSON-formatted data
following the [Singer
spec](https://github.com/singer-io/getting-started/blob/master/SPEC.md) from JSONL files.