> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slai.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK

> The library for creating and managing Beam apps

### Installation

<AccordionGroup>
  <Accordion title="Setup Virtual Environment" icon="circle-1" iconType="solid">
    Set up a new folder wherever you want and create a virtual env:

    ```curl theme={null}
    python3 -m virtualenv .venv
    ```

    Source virtual env:

    ```curl theme={null}
    source .venv/bin/activate
    ```
  </Accordion>

  <Accordion title="Install Beam SDK" icon="circle-2" iconType="solid">
    Install Beam SDK

    ```curl theme={null}
    pip install beam-sdk
    ```
  </Accordion>
</AccordionGroup>

### Defining a runtime

Your Beam runtime is defined in Python. Running the code below will create an
environment with the compute defined above, build the image, and hot reload as
you work.

```python theme={null}
beam.App(
	name="testapp",
	cpu=8,
	memory="4Gi",
	gpu=0,
	python_version="python3.8",
	python_packages=["numpy"],
)
```

### app() reference

| Field             | Type        | Description                                                                                                    |
| ----------------- | ----------- | -------------------------------------------------------------------------------------------------------------- |
| `name`            | *string*    | The name for your app                                                                                          |
| `cpu`             | *int, 0-16* | The number of CPU cores to provide to your runtime                                                             |
| `memory`          | *string*    | The amount of memory to provide to your runtime                                                                |
| `gpu`             | *int*       | The number of GPU cores to provide to your runtime                                                             |
| `python_version`  | *string*    | The Python version to install in your runtime                                                                  |
| `python_packages` | *array*     | The Python libraries to install in your runtime. These can have versioned specified, e.g. `tensorflow==0.2.10` |
