Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
portkey_config*.yaml
portkey_config*.yaml
**/.DS_Store
39 changes: 38 additions & 1 deletion charts/portkey-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Choose your storage backends from the options below. You'll need to configure:
**Cache Store**
- Cache configuration

**Vector Store** *(Optional)*
- For semantic caching with Milvus. See [Vector Store Setup](./docs/VectorStore.md)

---

## Analytics Store
Expand Down Expand Up @@ -241,6 +244,40 @@ LOG_STORE_BASEPATH: "<Custom S3 Base Path Including Bucket Name>"
```
</details>

### MinIO (Local/In-Cluster)
Simple deployments, development

```yaml

# Local (MinIO) object store configuration section
environment:
data:
LOG_STORE: local
LOG_STORE_GENERATIONS_BUCKET: "<Bucket Name>" # Bucket will automatically be create in MinIO by this Helm chart. Default portkey-log-store

minio:
name: "minio"
authKey:
create: true
accessKey: "portkey"
secretKey: "portkey123"
persistence:
enabled: true
size: 10Gi
storageClassName: "<Storage Class Name>" # Provide k8s storage class name to provision volumes for data persistence.
accessMode: ReadWriteOnce
```

**Notes**

* The values specified for `minio.authKey.accessKey` and `minio.authKey.secretKey` will be used as the MinIO `ROOT USERNAME` and `ROOT PASSWORD`.
* To access the MinIO WebUI console, port-forward the service to your local machine:
```sh
kubectl port-forward svc/minio 9001:9001
```
Then open `http://localhost:9001` in your browser.


### Azure Blob Storage
<details>
<summary>Detailed Azure Blob Storage Setup</summary>
Expand Down Expand Up @@ -451,4 +488,4 @@ helm uninstall portkey-gateway --namespace portkeyai
For additional help:
- Check the [full configuration reference](values.yaml)
- Review logs: `kubectl logs -n portkeyai deployment/portkey-gateway`
- Contact support(suport@portkey.ai) with your configuration details
- Contact support(support@portkey.ai) with your configuration details
112 changes: 111 additions & 1 deletion charts/portkey-gateway/docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
| `images.redisImage.repository` | string | `"docker.io/redis"` | Redis container image repository |
| `images.redisImage.pullPolicy` | string | `"IfNotPresent"` | Image pull policy for Redis |
| `images.redisImage.tag` | string | `"7.2-alpine"` | Redis image tag |
| `images.minioImage.repository` | string | `"minio/minio"` | MinIO container image repository |
| `images.minioImage.pullPolicy` | string | `"IfNotPresent"` | Image pull policy for MinIO |
| `images.minioImage.tag` | string | `"RELEASE.2025-09-07T16-13-09Z"` | MinIO image tag |
| `images.etcdImage.repository` | string | `"quay.io/coreos/etcd"` | etcd container image repository |
| `images.etcdImage.pullPolicy` | string | `"IfNotPresent"` | Image pull policy for etcd |
| `images.etcdImage.tag` | string | `"v3.5.5"` | etcd image tag |
| `images.milvusImage.repository` | string | `"milvusdb/milvus"` | Milvus container image repository |
| `images.milvusImage.pullPolicy` | string | `"IfNotPresent"` | Image pull policy for Milvus |
| `images.milvusImage.tag` | string | `"v2.3.21"` | Milvus image tag |
| `imagePullSecrets` | array | `[portkeyenterpriseregistrycredentials]` | Kubernetes secrets for pulling private images |

### Image Credentials
Expand Down Expand Up @@ -382,4 +391,105 @@ environment:
|----------|------|---------|-------------|
| `redis.name` | string | `"redis"` | Redis component name |
| `redis.containerPort` | integer | `6379` | Redis container port |
| `redis.resources` | object | `{}` | Resource requests and limits for Redis |
| `redis.resources` | object | `{}` | Resource requests and limits for Redis |

### MinIO Configuration

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `minio.name` | string | `"minio"` | MinIO component name |
| `minio.apiPort` | integer | `9000` | MinIO API port |
| `minio.consolePort` | integer | `9001` | MinIO WebUI console port |

#### MinIO Auth Key Secret

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `minio.authKey.create` | boolean | `true` | Create MinIO credentials secret |
| `minio.authKey.existingSecret` | string | `""` | Use existing secret for MinIO credentials |
| `minio.authKey.accessKey` | string | `"portkey"` | MinIO root username / access key |
| `minio.authKey.secretKey` | string | `"portkey123"` | MinIO root password / secret key |

#### MinIO StatefulSet

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `minio.statefulSet.labels` | object | `{}` | Labels for MinIO StatefulSet |
| `minio.statefulSet.annotations` | object | `{}` | Annotations for MinIO StatefulSet |
| `minio.statefulSet.podSecurityContext` | object | `{}` | Pod security context |
| `minio.statefulSet.securityContext` | object | `{}` | Container security context |
| `minio.statefulSet.resources` | object | `{}` | Resource requests and limits |
| `minio.statefulSet.nodeSelector` | object | `{}` | Node selector for scheduling |
| `minio.statefulSet.tolerations` | array | `[]` | Tolerations for scheduling |
| `minio.statefulSet.affinity` | object | `{}` | Affinity rules for scheduling |

#### MinIO Service

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `minio.service.type` | string | `"ClusterIP"` | MinIO service type |
| `minio.service.labels` | object | `{}` | Service labels |
| `minio.service.annotations` | object | `{}` | Service annotations |

#### MinIO Persistence

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `minio.persistence.enabled` | boolean | `true` | Enable persistent storage for MinIO |
| `minio.persistence.size` | string | `"10Gi"` | Storage size for MinIO data |
| `minio.persistence.storageClassName` | string | `""` | Storage class for MinIO PVC |
| `minio.persistence.accessMode` | string | `"ReadWriteOnce"` | PVC access mode |

### Milvus Configuration

> **Note**: Milvus requires MinIO for object storage. MinIO is deployed automatically when `environment.data.LOG_STORE: local` or `environment.data.VECTOR_STORE: local` is set.

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `environment.data.VECTOR_STORE` | string | `""` | Set to `local` to deploy in-cluster Milvus and auto-configure Gateway env vars |

#### Milvus etcd Configuration

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `milvus.etcd.port` | integer | `2379` | etcd client port |
| `milvus.etcd.env.autoCompactionMode` | string | `"revision"` | etcd auto compaction mode |
| `milvus.etcd.env.autoCompactionRetention` | string | `"1000"` | etcd auto compaction retention |
| `milvus.etcd.env.quotaBackendBytes` | string | `"4294967296"` | etcd backend quota in bytes |
| `milvus.etcd.env.snapshotCount` | string | `"50000"` | etcd snapshot count |
| `milvus.etcd.persistence.enabled` | boolean | `true` | Enable persistent storage for etcd |
| `milvus.etcd.persistence.size` | string | `"10Gi"` | Storage size for etcd data |
| `milvus.etcd.persistence.storageClassName` | string | `""` | Storage class for etcd PVC |
| `milvus.etcd.service.serviceType` | string | `"ClusterIP"` | etcd service type |
| `milvus.etcd.service.labels` | object | `{}` | etcd service labels |
| `milvus.etcd.service.annotations` | object | `{}` | etcd service annotations |
| `milvus.etcd.resources` | object | `{}` | Resource requests and limits for etcd |
| `milvus.etcd.statefulSet.labels` | object | `{}` | Labels for etcd StatefulSet |
| `milvus.etcd.statefulSet.annotations` | object | `{}` | Annotations for etcd StatefulSet |
| `milvus.etcd.statefulSet.podSecurityContext` | object | `{}` | Pod security context |
| `milvus.etcd.statefulSet.securityContext` | object | `{}` | Container security context |
| `milvus.etcd.statefulSet.nodeSelector` | object | `{}` | Node selector for scheduling |
| `milvus.etcd.statefulSet.tolerations` | array | `[]` | Tolerations for scheduling |
| `milvus.etcd.statefulSet.affinity` | object | `{}` | Affinity rules for scheduling |

#### Milvus Server Configuration

| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `milvus.grpcPort` | integer | `19530` | Milvus gRPC port |
| `milvus.httpPort` | integer | `9091` | Milvus HTTP port |
| `milvus.persistence.enabled` | boolean | `true` | Enable persistent storage for Milvus |
| `milvus.persistence.size` | string | `"10Gi"` | Storage size for Milvus data |
| `milvus.persistence.storageClassName` | string | `""` | Storage class for Milvus PVC |
| `milvus.persistence.accessMode` | string | `"ReadWriteOnce"` | PVC access mode |
| `milvus.service.serviceType` | string | `"ClusterIP"` | Milvus service type |
| `milvus.service.labels` | object | `{}` | Milvus service labels |
| `milvus.service.annotations` | object | `{}` | Milvus service annotations |
| `milvus.resources` | object | `{}` | Resource requests and limits for Milvus |
| `milvus.statefulSet.labels` | object | `{}` | Labels for Milvus StatefulSet |
| `milvus.statefulSet.annotations` | object | `{}` | Annotations for Milvus StatefulSet |
| `milvus.statefulSet.podSecurityContext` | object | `{}` | Pod security context |
| `milvus.statefulSet.securityContext` | object | `{}` | Container security context |
| `milvus.statefulSet.nodeSelector` | object | `{}` | Node selector for scheduling |
| `milvus.statefulSet.tolerations` | array | `[]` | Tolerations for scheduling |
| `milvus.statefulSet.affinity` | object | `{}` | Affinity rules for scheduling |
115 changes: 115 additions & 0 deletions charts/portkey-gateway/docs/VectorStore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Vector Store Configuration

This guide explains how to configure local/in-cluster Milvus as a vector store for semantic caching in Portkey Gateway.

## Enable MinIO in Helm Chart

Milvus requires MinIO for object storage. Ensure MinIO is enabled in your deployment before proceeding. See [MinIO setup in README](../README.md#minio-localin-cluster) for configuration details.

**Note:** If local MinIO is already enabled for log storage, skip this section and proceed to the next step.

## Enable Milvus in Helm Chart

Add the following to your `values.yaml`:

```yaml
environment:
data:
VECTOR_STORE: local

milvus:
name: "milvus"
persistence:
enabled: true
size: 10Gi
storageClassName: "" # Provide k8s storage class for creating storage volumes.
accessMode: ReadWriteOnce
etcd:
name: "etcd"
persistence:
enabled: true
size: 10Gi
storageClassName: "gp3" # Provide k8s storage class for creating storage volumes.
accessMode: ReadWriteOnce
```

## Access Milvus Instance

After deploying, port-forward the Milvus service to access it locally:

```sh
kubectl port-forward -n portkeyai svc/milvus 19530:19530
```

## Connect to Milvus

You can use a client like [Attu](https://github.com/zilliztech/attu) to connect to the Milvus instance:

| Field | Value |
|-------|-------|
| Host | `localhost:19530` |
| Username | `root` |
| Password | `Milvus` |

## Create Collection

Create the required collection for semantic caching. The example below creates a collection named `textEmbedding3Small` with 1536 dimensions (update `dim` based on your embedding model):

```sh
curl --location --request POST 'http://localhost:19530/v2/vectordb/collections/create' \
--header 'Authorization: Bearer root:Milvus' \
--header 'Content-Type: application/json' \
--data '{
"collectionName": "textEmbedding3Small",
"schema": {
"autoId": false,
"enableDynamicField": true,
"fields": [
{
"fieldName": "id",
"dataType": "VarChar",
"isPrimary": true,
"elementTypeParams": {
"max_length": 1024
}
},
{
"fieldName": "vector",
"dataType": "FloatVector",
"elementTypeParams": {
"dim": "1536"
}
},
{
"fieldName": "workspace_id",
"dataType": "VarChar",
"elementTypeParams": {
"max_length": 512
}
}
]
},
"indexParams": [
{
"fieldName": "vector",
"metricType": "COSINE",
"indexName": "vector",
"indexType": "AUTOINDEX"
}
],
"enableDynamicField": true
}'
```

### Verify Collection

Confirm the collection was created successfully:

```sh
curl --location --request POST 'http://localhost:19530/v2/vectordb/collections/describe' \
--header 'Authorization: Bearer root:Milvus' \
--header 'Content-Type: application/json' \
--data '{
"collectionName": "textEmbedding3Small"
}'
```
Loading