Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions examples/env_vars/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Auto Environment Loading for ServerlessResource
## Overview
The `ServerlessResource` class automatically loads environment variables from your .env file, simplifying configuration management for serverless deployments.
Features

- ***Zero-configuration***: Environment variables load automatically when creating a ServerlessResource
- ***Override capability***: Custom environment variables can still be provided when needed
- ***Simple integration***: Works with existing .env file.


```python
# Create with auto-loaded environment variables
resource = ServerlessResource(
name="inference-api",
templateId="template123"
# env automatically populated from .env file
)
```

or

```python
# You can Override the env vars in config
resource = ServerlessResource(
name="inference-api",
templateId="template123"
env={"CUSTOM_VAR": "custom_value"}
)
```