Metadata-Version: 2.4
Name: keras-remote
Version: 0.0.1
Summary: Run Keras models remotely on TPU seamlessly.
Project-URL: Homepage, https://github.com/keras-team/keras-remote
Project-URL: Issues, https://github.com/keras-team/keras-remote/issues
Author-email: Jeff Carpenter <code@jeffcarp.com>
License-Expression: Apache-2.0
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: cloudpickle
Requires-Dist: keras
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# Keras Remote

Run Keras models remotely on TPU as seamlessly as running the same code locally.

## Prerequisites

1.  **Google Cloud SDK**: Install the `gcloud` CLI.
2.  **Authentication**: Run `gcloud auth login` and `gcloud auth application-default login`.
3.  **Permissions**: Ensure your GCP user has permissions to create and manage TPU VMs.

## Installation

```bash
pip install -r requirements.txt
```

## Running the Demo

The `demo_train.py` script demonstrates how to run a Keras model on a remote TPU.

```bash
# Optional: Set your GCP project and zone
export KERAS_REMOTE_PROJECT="your-project-id"
export KERAS_REMOTE_ZONE="us-central1-f"  # or other zones like europe-west4-a

python demo_train.py
```

**Note:** TPU availability varies by zone. If you encounter a `RESOURCE_EXHAUSTED` error, try a different zone or accelerator type (e.g., `v2-8` vs `v3-8`).

The `@keras_remote.run` decorator handles:
1.  Packaging your local code.
2.  Provisioning (or finding) a TPU VM.
3.  Uploading your code and dependencies.
4.  Executing the function inside a Docker container on the TPU VM.
