-
Notifications
You must be signed in to change notification settings - Fork 116
feat: add deployment model classes #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+293
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add deployment model classes for different index deployment configurations: - ServerlessDeployment: for serverless indexes with cloud and region - ByocDeployment: for BYOC indexes with environment - PodDeployment: for pod-based indexes with environment, pod_type, replicas, shards Each class provides a to_dict() method that serializes to the API format. Closes SDK-103
jhamon
added a commit
that referenced
this pull request
Jan 28, 2026
## Summary
Add deployment model classes for different index deployment
configurations.
Closes SDK-103
## Classes
| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |
## Usage Example
```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment
# Serverless deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)
# BYOC deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)
# Pod deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=PodDeployment(
environment="us-east-1-aws",
pod_type="p1.x1",
replicas=2,
),
)
```
## Test Plan
- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon
added a commit
that referenced
this pull request
Jan 28, 2026
## Summary
Add deployment model classes for different index deployment
configurations.
Closes SDK-103
## Classes
| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |
## Usage Example
```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment
# Serverless deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)
# BYOC deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)
# Pod deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=PodDeployment(
environment="us-east-1-aws",
pod_type="p1.x1",
replicas=2,
),
)
```
## Test Plan
- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon
added a commit
that referenced
this pull request
Jan 28, 2026
## Summary
Add deployment model classes for different index deployment
configurations.
Closes SDK-103
## Classes
| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |
## Usage Example
```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment
# Serverless deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)
# BYOC deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)
# Pod deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=PodDeployment(
environment="us-east-1-aws",
pod_type="p1.x1",
replicas=2,
),
)
```
## Test Plan
- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon
added a commit
that referenced
this pull request
Jan 28, 2026
## Summary
Add deployment model classes for different index deployment
configurations.
Closes SDK-103
## Classes
| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |
## Usage Example
```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment
# Serverless deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)
# BYOC deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)
# Pod deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=PodDeployment(
environment="us-east-1-aws",
pod_type="p1.x1",
replicas=2,
),
)
```
## Test Plan
- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon
added a commit
that referenced
this pull request
Jan 28, 2026
## Summary
Add deployment model classes for different index deployment
configurations.
Closes SDK-103
## Classes
| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |
## Usage Example
```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment
# Serverless deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)
# BYOC deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)
# Pod deployment
pc.create_index(
name="my-index",
schema=schema,
deployment=PodDeployment(
environment="us-east-1-aws",
pod_type="p1.x1",
replicas=2,
),
)
```
## Test Plan
- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add deployment model classes for different index deployment configurations.
Closes SDK-103
Classes
ServerlessDeploymentserverlesscloud,regionByocDeploymentbyocenvironmentPodDeploymentpodenvironment,pod_type,replicas,shardsUsage Example
Test Plan
Note
Low Risk
Low risk: this PR only adds new model/dataclass types and exports them; it doesn’t change existing request flows, but downstream code may start relying on the new
to_dictserialization format.Overview
Adds new deployment configuration dataclasses (
ServerlessDeployment,ByocDeployment,PodDeployment) withto_dict()serialization and aDeploymentunion type indb_control/models/deployment.py.Exports these types through
pinecone.db_control.modelsand top-levelpineconelazy imports, and adds unit tests validating constructor defaults andto_dict()output across deployment variants.Written by Cursor Bugbot for commit c2e965d. This will update automatically on new commits. Configure here.