Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

release: v0.6.4

github-actions[bot]ca0e83ff0ec5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0566667d8..469572361 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Changelog
+## v0.6.4
+
+- chore(main): release 0.6.4
+- fix(sidecar): preserve msgpack work item payloads
+- fix(gateway): resubscribe stale NATS health stream
+- feat(helm): ship values-aks.yaml AKS overlay with the Azure module
+- fix(helm): render selectorLabels after podLabels in workload templates
+- feat(helm): expose chart-level podLabels for Workload Identity wiring
+- feat(helm): accept abfs:// and abfss:// payloadStore + clusterCache URLs
+
## v0.6.3
- chore(main): release 0.6.3
diff --git a/deploy/helm/sie-cluster/Chart.yaml b/deploy/helm/sie-cluster/Chart.yaml
index 1cd2fe62f..b524b3a01 100644
--- a/deploy/helm/sie-cluster/Chart.yaml
+++ b/deploy/helm/sie-cluster/Chart.yaml
@@ -4,8 +4,8 @@ description: >-
SIE (Search Inference Engine) Kubernetes deployment with gateway, GPU workers,
and observability
type: application
-version: 0.6.3 # x-release-please-version
-appVersion: v0.6.3 # x-release-please-version
+version: 0.6.4 # x-release-please-version
+appVersion: v0.6.4 # x-release-please-version
keywords:
- inference
- embedding
diff --git a/deploy/helm/sie-cluster/templates/_helpers.tpl b/deploy/helm/sie-cluster/templates/_helpers.tpl
index 2a4cb9931..676846716 100644
--- a/deploy/helm/sie-cluster/templates/_helpers.tpl
+++ b/deploy/helm/sie-cluster/templates/_helpers.tpl
@@ -429,10 +429,19 @@ Resolution order:
before appending "/payloads". The resulting layout is:
<bucket-or-container>/models/... weights (managed by sie-admin cache)
<bucket-or-container>/payloads/... large work-item refs (managed by gateway)
- These siblings live at the bucket/container root, which is what supported
- cloud workload IAM grants are scoped to.
+ These siblings live at the bucket/container root, which is what the
+ workload IAM grants are scoped to in all three (AWS, GCP, Azure)
+ terraform modules.
3. Otherwise -> empty string (payload store is off, no env vars rendered).
+Supported URL schemes: s3:// (AWS), gs:// (GCP), abfs:// + abfss:// (Azure
+Data Lake Storage Gen2 / Blob with hierarchical namespace enabled). The
+Azure scheme variant is treated identically to the AWS/GCP variants for
+the derivation step — the trailing "/models" → "/payloads" swap works
+the same way because Azure URLs follow the same
+"<scheme>://<container>@<account>.dfs.core.windows.net/<prefix>"
+convention exposed by the deploy/terraform/azure module.
+
Templates that consume this should treat a non-empty result as "payload
store enabled" and an empty result as "off".
*/}}
diff --git a/deploy/helm/sie-cluster/templates/config-deployment.yaml b/deploy/helm/sie-cluster/templates/config-deployment.yaml
index cb2e3971b..3e667cb9a 100644
--- a/deploy/helm/sie-cluster/templates/config-deployment.yaml
+++ b/deploy/helm/sie-cluster/templates/config-deployment.yaml
@@ -42,6 +42,11 @@ spec:
template:
metadata:
labels:
+ {{- with .Values.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- /* Render selectorLabels last so user-supplied podLabels cannot
+ override the Deployment selector contract. */ -}}
{{- include "sie-cluster.config.selectorLabels" . | nindent 8 }}
{{- with .Values.config.podAnnotations }}
annotations:
diff --git a/deploy/helm/sie-cluster/templates/gateway-deployment.yaml b/deploy/helm/sie-cluster/templates/gateway-deployment.yaml
index e181df75e..c44e81a7c 100644
--- a/deploy/helm/sie-cluster/templates/gateway-deployment.yaml
+++ b/deploy/helm/sie-cluster/templates/gateway-deployment.yaml
@@ -36,7 +36,9 @@
{{- /* Resolve the effective payload-store URL once (helper applies the
auto-derivation: explicit url > clusterCache.url + /payloads > empty).
The chart treats a non-empty resolved URL as "payload store enabled"
- and rejects local paths so misconfigured queue clusters fail fast. */}}
+ and rejects local paths so misconfigured queue clusters fail fast.
+ Supported schemes: s3:// (AWS), gs:// (GCP), abfs:// + abfss:// (Azure
+ Data Lake Storage Gen2 / Blob via the hierarchical namespace). */}}
{{- $payloadStoreUrl := include "sie-cluster.payloadStoreUrl" . }}
{{- if $payloadStoreUrl }}
{{- if not (or (hasPrefix "s3://" $payloadStoreUrl) (hasPrefix "gs://" $payloadStoreUrl) (hasPrefix "abfs://" $payloadStoreUrl) (hasPrefix "abfss://" $payloadStoreUrl)) }}
@@ -58,6 +60,11 @@ spec:
template:
metadata:
labels:
+ {{- with .Values.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- /* Render selectorLabels last so user-supplied podLabels cannot
+ override the Deployment selector contract. */ -}}
{{- include "sie-cluster.gateway.selectorLabels" . | nindent 8 }}
{{- with .Values.gateway.podAnnotations }}
annotations:
diff --git a/deploy/helm/sie-cluster/templates/serviceaccount.yaml b/deploy/helm/sie-cluster/templates/serviceaccount.yaml
index 9b41aa370..72480ad30 100644
--- a/deploy/helm/sie-cluster/templates/serviceaccount.yaml
+++ b/deploy/helm/sie-cluster/templates/serviceaccount.yaml
@@ -6,6 +6,8 @@
in the environment-specific values override (e.g., gcp/k8s/sie.tf).
EKS: eks.amazonaws.com/role-arn annotation is injected via serviceAccount.annotations
in values-aws.yaml or via --set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"=<ARN>.
+ AKS: azure.workload.identity/client-id annotation is injected via serviceAccount.annotations
+ and azure.workload.identity/use label via serviceAccount.labels / podLabels.
If overriding serviceAccount.name, update the matching TF variable sie_service_account_name.
*/ -}}
apiVersion: v1
@@ -15,6 +17,9 @@ metadata:
namespace: {{ include "sie-cluster.namespace" . }}
labels:
{{- include "sie-cluster.labels" . | nindent 4 }}
+ {{- with .Values.serviceAccount.labels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
diff --git a/deploy/helm/sie-cluster/templates/worker-statefulset.yaml b/deploy/helm/sie-cluster/templates/worker-statefulset.yaml
index 0c58b3bee..92d97a477 100644
--- a/deploy/helm/sie-cluster/templates/worker-statefulset.yaml
+++ b/deploy/helm/sie-cluster/templates/worker-statefulset.yaml
@@ -66,6 +66,11 @@ spec:
template:
metadata:
labels:
+ {{- with $root.Values.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- /* Render selectorLabels last so user-supplied podLabels cannot
+ override the StatefulSet selector contract. */ -}}
{{- include "sie-cluster.worker.selectorLabels" $root | nindent 8 }}
sie.superlinked.com/gpu-type: {{ $pool.gpuType | quote }}
sie.superlinked.com/machine-profile: {{ $machineProfile | quote }}
diff --git a/deploy/helm/sie-cluster/values-aks.yaml b/deploy/helm/sie-cluster/values-aks.yaml
new file mode 100644
index 000000000..7ae5b277d
--- /dev/null
+++ b/deploy/helm/sie-cluster/values-aks.yaml
@@ -0,0 +1,172 @@
+# Azure AKS specific values
+fullnameOverride: sie
+
+podLabels:
+ azure.workload.identity/use: "true"
+
+# Sub-charts shipped with this overlay
+keda:
+ install: true
+
+kube-prometheus-stack:
+ install: true
+ # AKS manages its own control plane — disable control-plane monitors
+ kubeApiServer:
+ enabled: false
+ kubeControllerManager:
+ enabled: false
+ kubeScheduler:
+ enabled: false
+ kubeProxy:
+ enabled: false
+ kubeEtcd:
+ enabled: false
+
+observability:
+ logs:
+ install: true
+
+kubernetes-event-exporter:
+ install: false
+
+# Autoscaling via KEDA (queries Prometheus for scaling decisions)
+# prometheusAddress is auto-derived when kube-prometheus-stack.install=true
+autoscaling:
+ enabled: true
+ # 600s / 300s — survives transient idle gaps without churning nodes
+ cooldownPeriod: 600
+ scaleDownStabilization: 300
+
+# Enable Prometheus scraping (required for KEDA autoscaling)
+serviceMonitor:
+ enabled: true
+ labels:
+ app.kubernetes.io/part-of: sie
+
+# Azure machine profiles (extends base machineProfiles)
+machineProfiles:
+ # Azure Standard_NC4as_T4_v3 (NVIDIA T4)
+ t4:
+ gpuType: nvidia-t4
+ machineType: Standard_NC4as_T4_v3
+ spot: true
+ # Azure Standard_NV6ads_A10_v5 (NVIDIA A10)
+ a10:
+ gpuType: nvidia-a10
+ machineType: Standard_NV6ads_A10_v5
+ spot: true
+
+# Ingress via nginx-ingress
+ingress:
+ enabled: true
+ className: nginx
+ # TLS defaults to BYO (user-supplied kubernetes.io/tls Secret).
+ # Three other modes are supported:
+ #
+ # 1) cert-manager + Let's Encrypt (external cert-manager install):
+ # hosts:
+ # - sie.example.com
+ # tlsConfig:
+ # enabled: true
+ # mode: cert-manager
+ # certManager:
+ #
+ # 2) self-signed (air-gapped / on-prem; bundles cert-manager — single-tenant clusters only):
+ # hosts:
+ # - sie.example.com
+ # tlsConfig:
+ # enabled: true
+ # mode: self-signed
+ # # And at the top level:
+ # # certManagerBundle:
+ # # certManager:
+ # # install: true
+ #
+ # 3) disabled (TLS terminated upstream of the Ingress):
+ # tlsConfig:
+ # enabled: false
+ # mode: disabled
+
+gateway:
+ # HA configuration
+ replicas: 2
+ # Force repull to get latest image
+ image:
+ pullPolicy: Always
+ # Resources baseline
+ resources:
+ requests:
+ cpu: "500m"
+ memory: "512Mi"
+ limits:
+ cpu: "2"
+ memory: "2Gi"
+
+# sie-config control plane (singleton by design — see chart values.yaml for
+# the HA caveat). Mirroring the gateway's pullPolicy/resources so AKS installs
+# are representative of a full sie-cluster deployment.
+config:
+ enabled: true
+ image:
+ pullPolicy: Always
+ resources:
+ requests:
+ cpu: "100m"
+ memory: "256Mi"
+ limits:
+ cpu: "1"
+ memory: "1Gi"
+
+workers:
+ pools:
+ # Azure Standard_NC4as_T4_v3 pool (NVIDIA T4)
+ t4:
+ enabled: true
+ machineProfile: t4
+ gpuType: t4
+ # AKS GPU pools use taints; no cloud-specific node selector is required.
+ nodeSelector: {}
+ gpu:
+ count: 1
+ product: NVIDIA-T4
+ resources:
+ requests:
+ cpu: "2"
+ memory: "8Gi"
+ limits:
+ cpu: "4"
+ memory: "16Gi"
+ tolerations:
+ - key: nvidia.com/gpu
+ operator: Exists
+ effect: NoSchedule
+ bundles:
+ default:
+ minReplicas: 0
+ maxReplicas: 10
+
+# ServiceAccount — Helm manages creation; Azure Workload Identity annotation
+# must be injected at deploy time.
+# NAMING CONTRACT: name must match the Azure module's sie_service_account_name
+# (default "sie-server") and namespace (default "sie").
+# To inject the workload identity client ID at deploy time:
+# --set serviceAccount.annotations."azure\.workload\.identity/client-id"=<client-id>
+# Note: The hf-token secret is NOT created by the Helm chart. It must be created
+# manually on new clusters before deploying.
+# Bash (read -rsp is bash-only):
+# read -rsp "HF token: " HF_TOKEN; echo
+# kubectl create secret generic hf-token --from-literal=token="$HF_TOKEN" -n sie
+# unset HF_TOKEN
+# Or create from a file (then remove the file): kubectl create secret generic hf-token --from-file=token=/path/to/token -n sie
+serviceAccount:
+ create: true
+ name: "sie-server"
+ labels:
+ azure.workload.identity/use: "true"
+ annotations: {}
+ # azure.workload.identity/client-id: <client-id> # inject via --set at deploy time
+
+dcgm-exporter:
+ # AKS GPU nodes use taints; no node selector required
+ nodeSelector: {}
diff --git a/deploy/helm/sie-cluster/values.yaml b/deploy/helm/sie-cluster/values.yaml
index 023faa9ff..c0f4108e9 100644
--- a/deploy/helm/sie-cluster/values.yaml
+++ b/deploy/helm/sie-cluster/values.yaml
@@ -19,6 +19,18 @@ global:
# -- Namespace override (defaults to release namespace)
namespace: ""
+# -- Pod labels added to every pod template managed by this chart
+# (gateway, config, workers). Selector labels are not affected — these are
+# appended after the selector labels and cannot rename them.
+#
+# Common uses:
+# AKS Workload Identity:
+# podLabels:
+# azure.workload.identity/use: "true"
+# GKE Workload Identity needs no pod label (annotation-only flow).
+# EKS IRSA needs no pod label (annotation-only flow).
+podLabels: {}
+
# -- Filesystem seed paths consumed only by sie-config (the gateway no longer
# bakes a seed: it pulls bundles+models from sie-config at startup via
# /v1/configs/bundles and /v1/configs/export; see
@@ -360,10 +372,10 @@ workers:
# -- Cluster cache (object storage) configuration
clusterCache:
enabled: false
- # -- Object-store URL with the /models prefix (for example,
- # s3://my-bucket/models, gs://my-bucket/models, or
- # abfs(s)://[email protected]/models).
- # AWS users: get this from `terraform output -raw model_cache_bucket_url`.
+ # -- Object-store URL with the /models prefix. Supported schemes:
+ # - s3://<bucket>/models (AWS — terraform output -raw model_cache_bucket_url)
+ # - gs://<bucket>/models (GCP — same output name)
+ # - abfs(s)://<container>@<account>.dfs.core.windows.net/models (Azure ADLS Gen2 — same output name)
# Pre-populate the bucket once with `sie-admin cache weights sync --bundle default --dest <url>/`.
url: ""
@@ -916,6 +928,8 @@ serviceAccount:
create: true
# -- Service account name. Must match KSA name in Terraform WI/IRSA binding.
name: "sie-server"
+ # -- Labels (e.g., azure.workload.identity/use=true for Azure Workload Identity)
+ labels: {}
# -- Annotations (e.g., for Workload Identity)
annotations: {}
# Example for GKE Workload Identity:
@@ -1101,8 +1115,11 @@ queueRouting:
# -- Payload store for large work item payloads (images, long documents).
# When a work item exceeds 1MB, the payload is offloaded to this store.
# IMPORTANT: payloadStore.url must point to shared storage accessible by both
-# gateway and worker pods. Use s3://bucket/prefix, gs://bucket/prefix, or
-# abfs(s)://[email protected]/prefix.
+# gateway and worker pods. Supported schemes:
+# - s3://<bucket>/<prefix> (AWS S3)
+# - gs://<bucket>/<prefix> (GCP GCS)
+# - abfs://<container>@<account>.dfs.core.windows.net/<prefix> (Azure ADLS Gen2)
+# - abfss://... (same as abfs, TLS-only enforced by the SDK)
# Local filesystem paths (e.g., /tmp/payloads) will NOT work in queue mode
# because gateway and worker pods have different filesystems.
#
@@ -1115,13 +1132,13 @@ queueRouting:
# top-level sibling prefixes:
# <bucket>/models/... model weights (managed by sie-admin)
# <bucket>/payloads/... large work-item refs (managed by gateway)
-# The supported cloud modules scope their workload IAM grants to
-# these top-level prefixes, so the auto-derived URL aligns with the permissions
-# out of the box. Set payloadStore.url explicitly only to override the
-# default (e.g., a separate bucket); leaving it empty is the right call
+# All three terraform modules (AWS, GCP, Azure) scope their workload IAM
+# grants to these top-level prefixes, so the auto-derived URL aligns with the
+# permissions out of the box. Set payloadStore.url explicitly only to override
+# the default (e.g., a separate bucket); leaving it empty is the right call
# for most clusters.
payloadStore:
- # -- Payload store URL. Must be an S3, GCS, or Azure Blob URL
+ # -- Payload store URL. Supported schemes: s3://, gs://, abfs://, abfss://
# (s3://bucket/prefix, gs://bucket/prefix, or abfs(s)://[email protected]/prefix).
# Local paths are rejected when clusterRouting=queue (see gateway-deployment.yaml validation).
# Leave empty to auto-derive from workers.common.clusterCache.url (recommended).
diff --git a/integrations/sie_chroma/pyproject.toml b/integrations/sie_chroma/pyproject.toml
index a8702e3dd..a565e6d0b 100644
--- a/integrations/sie_chroma/pyproject.toml
+++ b/integrations/sie_chroma/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-chroma"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for ChromaDB"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/integrations/sie_crewai/pyproject.toml b/integrations/sie_crewai/pyproject.toml
index b08539ed6..b61918701 100644
--- a/integrations/sie_crewai/pyproject.toml
+++ b/integrations/sie_crewai/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-crewai"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for CrewAI"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/integrations/sie_dspy/pyproject.toml b/integrations/sie_dspy/pyproject.toml
index b32574eaa..8c3a919e6 100644
--- a/integrations/sie_dspy/pyproject.toml
+++ b/integrations/sie_dspy/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-dspy"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for DSPy"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/integrations/sie_haystack/pyproject.toml b/integrations/sie_haystack/pyproject.toml
index 64708b1de..d91447343 100644
--- a/integrations/sie_haystack/pyproject.toml
+++ b/integrations/sie_haystack/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-haystack"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for Haystack"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/integrations/sie_lancedb/pyproject.toml b/integrations/sie_lancedb/pyproject.toml
index dee32c3f3..e15dd838e 100644
--- a/integrations/sie_lancedb/pyproject.toml
+++ b/integrations/sie_lancedb/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-lancedb"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for LanceDB"
requires-python = ">=3.12"
dependencies = [
diff --git a/integrations/sie_langchain/pyproject.toml b/integrations/sie_langchain/pyproject.toml
index 3f805da84..9fa30c951 100644
--- a/integrations/sie_langchain/pyproject.toml
+++ b/integrations/sie_langchain/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-langchain"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for LangChain"
requires-python = ">=3.10"
dependencies = [
diff --git a/integrations/sie_llamaindex/pyproject.toml b/integrations/sie_llamaindex/pyproject.toml
index f877999d7..dd1aa3d79 100644
--- a/integrations/sie_llamaindex/pyproject.toml
+++ b/integrations/sie_llamaindex/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-llamaindex"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for LlamaIndex"
requires-python = ">=3.10"
dependencies = [
diff --git a/integrations/sie_qdrant/pyproject.toml b/integrations/sie_qdrant/pyproject.toml
index 37d94ee54..0c09d1963 100644
--- a/integrations/sie_qdrant/pyproject.toml
+++ b/integrations/sie_qdrant/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-qdrant"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for Qdrant"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/integrations/sie_ts_chroma/package.json b/integrations/sie_ts_chroma/package.json
index e18571768..1ceb14645 100644
--- a/integrations/sie_ts_chroma/package.json
+++ b/integrations/sie_ts_chroma/package.json
@@ -1,6 +1,6 @@
{
"name": "@superlinked/sie-chroma",
- "version": "0.6.3",
+ "version": "0.6.4",
"description": "SIE embedding function for ChromaDB",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/integrations/sie_ts_lancedb/package.json b/integrations/sie_ts_lancedb/package.json
index 3e7480fc5..4941fa246 100644
--- a/integrations/sie_ts_lancedb/package.json
+++ b/integrations/sie_ts_lancedb/package.json
@@ -1,6 +1,6 @@
{
"name": "@superlinked/sie-lancedb",
- "version": "0.6.3",
+ "version": "0.6.4",
"description": "SIE embedding function and reranker for LanceDB",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/integrations/sie_ts_langchain/package.json b/integrations/sie_ts_langchain/package.json
index be44f7433..3b58e4953 100644
--- a/integrations/sie_ts_langchain/package.json
+++ b/integrations/sie_ts_langchain/package.json
@@ -1,6 +1,6 @@
{
"name": "@superlinked/sie-langchain",
- "version": "0.6.3",
+ "version": "0.6.4",
"description": "SIE embeddings integration for LangChain.js",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/integrations/sie_ts_llamaindex/package.json b/integrations/sie_ts_llamaindex/package.json
index c4fede69e..18b5b4903 100644
--- a/integrations/sie_ts_llamaindex/package.json
+++ b/integrations/sie_ts_llamaindex/package.json
@@ -1,6 +1,6 @@
{
"name": "@superlinked/sie-llamaindex",
- "version": "0.6.3",
+ "version": "0.6.4",
"description": "SIE embeddings integration for LlamaIndex.TS",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/integrations/sie_weaviate/pyproject.toml b/integrations/sie_weaviate/pyproject.toml
index 41a89e67f..e19411131 100644
--- a/integrations/sie_weaviate/pyproject.toml
+++ b/integrations/sie_weaviate/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-weaviate"
-version = "0.6.3"
+version = "0.6.4"
description = "SIE integration for Weaviate"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/packages/sie_gateway/Cargo.lock b/packages/sie_gateway/Cargo.lock
index 37717a435..6981a7996 100644
--- a/packages/sie_gateway/Cargo.lock
+++ b/packages/sie_gateway/Cargo.lock
@@ -2960,7 +2960,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
[[package]]
name = "sie-gateway"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"arc-swap",
"async-nats",
diff --git a/packages/sie_gateway/Cargo.toml b/packages/sie_gateway/Cargo.toml
index 0a3b22a9b..92898a618 100644
--- a/packages/sie_gateway/Cargo.toml
+++ b/packages/sie_gateway/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sie-gateway"
-version = "0.6.3"
+version = "0.6.4"
edition = "2021"
publish = false
diff --git a/packages/sie_gateway/docs/architecture-guide.md b/packages/sie_gateway/docs/architecture-guide.md
index 7d394c388..69615c50f 100644
--- a/packages/sie_gateway/docs/architecture-guide.md
+++ b/packages/sie_gateway/docs/architecture-guide.md
@@ -191,7 +191,7 @@ Independently of bootstrap and polling, `NatsManager` subscribes to `sie.config.
- A non-empty body is parsed as `ModelConfig` YAML. If the parse fails, the epoch is NOT advanced and the event is logged. The poller will catch up.
- On successful parse, `ModelRegistry.add_model_config` is called. If it returns `Ok`, the epoch is advanced. If it returns `Err` (e.g. append-only conflict, unroutable adapter), the epoch is NOT advanced.
-`ConfigEpoch::set_max` uses a CAS loop over `AtomicU64`. The value only ever moves forward; a late-arriving lower-epoch delta cannot roll it back. `async_nats::Subscriber` survives reconnects transparently, so the gateway does not need explicit resubscribe logic — any messages published while the subscriber is disconnected are simply lost, which is the gap the poller closes.
+`ConfigEpoch::set_max` uses a CAS loop over `AtomicU64`. The value only ever moves forward; a late-arriving lower-epoch delta cannot roll it back. `async_nats::Subscriber` survives reconnects transparently, so the config-delta path does not need explicit resubscribe logic — any messages published while the subscriber is disconnected are simply lost, which is the gap the poller closes.
## 5. Gateway Read Surface
@@ -284,7 +284,7 @@ Per-subject transport:
| Generation direct-dispatch | `sie.work.{pool}.{machine_profile}.{bundle}.{model}.{worker_id}` | JetStream | Worker-specific stream used only by pools that host generation-capable models. Non-generation workers must not create or poll this stream; keeping them pool-only preserves queue batching for `encode` / `score` / `extract`. |
| Inference results | `_INBOX.{router_id}.{request_id}` | NATS Core | Gateway is waiting synchronously; a brief blip after publish but before delivery means the result is lost and the client retries (the gateway returns `503` with `X-SIE-Error-Code: MODEL_LOADING` and `Retry-After: 5` — see §2). Result payload is msgpack. |
| Config deltas | `sie.config.models.{bundle}`, `sie.config.models._all` | NATS Core | Lightweight fan-out. Gateway durability comes from the snapshot/export path (§4), not the bus. JSON payload (control plane, not hot path). The gateway subscribes on `_all`; worker-sidecar containers subscribe on their bundle subject and apply through Python IPC. |
-| Worker health | `sie.health.>` | NATS Core | Ephemeral, last-heartbeat-wins. The gateway subscribes in `health_mode=nats` (see `discovery/nats_health.rs`). Worker-sidecar containers publish this heartbeat and include the latest bundle hash after successful config apply; the **default `health_mode=ws`** still uses the Python WebSocket path. |
+| Worker health | `sie.health.>` | NATS Core | Ephemeral, last-heartbeat-wins. The gateway subscribes in `health_mode=nats` (see `discovery/nats_health.rs`) and supervises the subscriber task: reconnects normally resume in `async-nats`, but a terminated subscription stream is recreated with bounded backoff because there is no full-state health poller. Worker-sidecar containers publish this heartbeat and include the latest bundle hash after successful config apply; the **default `health_mode=ws`** still uses the Python WebSocket path. |
| DLQ advisories | `$JS.EVENT.ADVISORY.CONSUMER.MAX_DELIVERIES.>` | NATS Core (advisory) | JetStream emits these; the gateway subscribes in `queue/dlq.rs`. |
| DLQ storage | `sie.dlq.{model_token}` | JetStream | Single stream `DEAD_LETTERS` (Limits retention, memory storage, 24 h `max_age`) captures `sie.dlq.>`. `model_token` is derived from the advisory's original work subject by taking the model segment and replacing `/` with `_`. |
diff --git a/packages/sie_gateway/openapi.json b/packages/sie_gateway/openapi.json
index 8665a2d11..1a4cd0a98 100644
--- a/packages/sie_gateway/openapi.json
+++ b/packages/sie_gateway/openapi.json
@@ -2908,7 +2908,7 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"title": "SIE Gateway",
- "version": "0.6.3"
+ "version": "0.6.4"
},
"openapi": "3.1.0",
"paths": {
diff --git a/packages/sie_gateway/src/discovery/nats_health.rs b/packages/sie_gateway/src/discovery/nats_health.rs
index 179221dd6..2e25ff0f2 100644
--- a/packages/sie_gateway/src/discovery/nats_health.rs
+++ b/packages/sie_gateway/src/discovery/nats_health.rs
@@ -7,6 +7,10 @@ use tracing::{info, warn};
use crate::state::worker_registry::WorkerRegistry;
use crate::types::WorkerStatusMessage;
+const HEALTH_SUBJECT: &str = "sie.health.>";
+const RESUBSCRIBE_INITIAL_DELAY: Duration = Duration::from_secs(1);
+const RESUBSCRIBE_MAX_DELAY: Duration = Duration::from_secs(30);
+
pub struct NatsHealthManager {
registry: Arc<WorkerRegistry>,
cancel_tx: tokio::sync::watch::Sender<()>,
@@ -28,14 +32,15 @@ impl NatsHealthManager {
&self,
client: &async_nats::Client,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
- let sub = client.subscribe("sie.health.>").await?;
- info!("subscribed to sie.health.>");
+ let sub = subscribe_health(client).await?;
+ info!(subject = HEALTH_SUBJECT, "subscribed to NATS health");
let registry = Arc::clone(&self.registry);
+ let client = client.clone();
let mut cancel_rx = self.cancel_rx.clone();
tokio::spawn(async move {
- run_subscription(registry, sub, &mut cancel_rx).await;
+ run_subscription_supervised(registry, client, sub, &mut cancel_rx).await;
});
Ok(())
@@ -72,29 +77,135 @@ impl NatsHealthManager {
}
}
-async fn run_subscription(
+async fn subscribe_health(
+ client: &async_nats::Client,
+) -> Result<async_nats::Subscriber, Box<dyn std::error::Error + Send + Sync>> {
+ Ok(client.subscribe(HEALTH_SUBJECT).await?)
+}
+
+#[derive(Debug, PartialEq, Eq)]
+enum SubscriptionExit {
+ Ended { messages: u64 },
+ Cancelled,
+}
+
+#[derive(Debug)]
+struct ResubscribeBackoff {
+ initial: Duration,
+ next: Duration,
+ max: Duration,
+}
+
+impl ResubscribeBackoff {
+ fn new(initial: Duration, max: Duration) -> Self {
+ Self {
+ initial,
+ next: initial,
+ max,
+ }
+ }
+
+ fn next_delay(&mut self) -> Duration {
+ let delay = self.next;
+ self.next = self.next.checked_mul(2).unwrap_or(self.max).min(self.max);
+ delay
+ }
+
+ fn reset(&mut self) {
+ self.next = self.initial;
+ }
+}
+
+async fn run_subscription_supervised(
registry: Arc<WorkerRegistry>,
- mut sub: async_nats::Subscriber,
+ client: async_nats::Client,
+ initial_sub: async_nats::Subscriber,
cancel_rx: &mut tokio::sync::watch::Receiver<()>,
) {
+ let mut backoff = ResubscribeBackoff::new(RESUBSCRIBE_INITIAL_DELAY, RESUBSCRIBE_MAX_DELAY);
+ let mut next_sub = Some(initial_sub);
+
+ loop {
+ let sub = match next_sub.take() {
+ Some(sub) => sub,
+ None => match subscribe_health(&client).await {
+ Ok(sub) => {
+ info!(subject = HEALTH_SUBJECT, "resubscribed to NATS health");
+ sub
+ }
+ Err(error) => {
+ let delay = backoff.next_delay();
+ warn!(
+ subject = HEALTH_SUBJECT,
+ error = %error,
+ delay_ms = delay.as_millis() as u64,
+ "failed to resubscribe to NATS health"
+ );
+ if sleep_or_cancel(delay, cancel_rx).await {
+ info!("NATS health subscription cancelled");
+ return;
+ }
+ continue;
+ }
+ },
+ };
+
+ match run_subscription_until_end(Arc::clone(&registry), sub, cancel_rx).await {
+ SubscriptionExit::Cancelled => return,
+ SubscriptionExit::Ended { messages } => {
+ if messages > 0 {
+ backoff.reset();
+ }
+ let delay = backoff.next_delay();
+ warn!(
+ subject = HEALTH_SUBJECT,
+ messages,
+ delay_ms = delay.as_millis() as u64,
+ "NATS health subscription stream ended; resubscribing"
+ );
+ if sleep_or_cancel(delay, cancel_rx).await {
+ info!("NATS health subscription cancelled");
+ return;
+ }
+ }
+ }
+ }
+}
+
+async fn sleep_or_cancel(
+ delay: Duration,
+ cancel_rx: &mut tokio::sync::watch::Receiver<()>,
+) -> bool {
+ tokio::select! {
+ _ = tokio::time::sleep(delay) => false,
+ _ = cancel_rx.changed() => true,
+ }
+}
+
+async fn run_subscription_until_end(
+ registry: Arc<WorkerRegistry>,
+ mut sub: async_nats::Subscriber,
+ cancel_rx: &mut tokio::sync::watch::Receiver<()>,
+) -> SubscriptionExit {
info!("NATS health subscription handler started");
+ let mut messages = 0u64;
loop {
tokio::select! {
msg = sub.next() => {
match msg {
Some(msg) => {
+ messages = messages.saturating_add(1);
handle_nats_message(&registry, msg).await;
}
None => {
- warn!("NATS subscription stream ended");
- break;
+ return SubscriptionExit::Ended { messages };
}
}
}
_ = cancel_rx.changed() => {
info!("NATS health subscription cancelled");
- break;
+ return SubscriptionExit::Cancelled;
}
}
}
@@ -216,4 +327,23 @@ mod tests {
assert!(registry.workers().await.is_empty());
assert!(registry.healthy_workers().await.is_empty());
}
+
+ #[test]
+ fn resubscribe_backoff_doubles_to_cap() {
+ let mut backoff = ResubscribeBackoff::new(Duration::from_secs(1), Duration::from_secs(5));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(1));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(2));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(4));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(5));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(5));
+ }
+
+ #[test]
+ fn resubscribe_backoff_reset_returns_to_initial_delay() {
+ let mut backoff = ResubscribeBackoff::new(Duration::from_secs(1), Duration::from_secs(5));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(1));
+ assert_eq!(backoff.next_delay(), Duration::from_secs(2));
+ backoff.reset();
+ assert_eq!(backoff.next_delay(), Duration::from_secs(1));
+ }
}
diff --git a/packages/sie_gateway/src/main.rs b/packages/sie_gateway/src/main.rs
index dd19c469d..9f2ceb32f 100644
--- a/packages/sie_gateway/src/main.rs
+++ b/packages/sie_gateway/src/main.rs
@@ -296,9 +296,9 @@ async fn run_server(cfg: Config) -> Result<(), Box<dyn std::error::Error>> {
//
// `async_nats::Subscriber` survives reconnects transparently, so
// `start_subscription` is a one-shot and we don't need to wire it
- // to `reconnect_notify` the way health and inbox do — those two
- // actually need to rebuild JetStream/request-reply state after a
- // server restart, but Core pub/sub subscriptions auto-resume.
+ // to `reconnect_notify` the way the inbox does — request-reply state
+ // needs an explicit rebuild after a server restart, while Core pub/sub
+ // subscriptions normally auto-resume.
// Staleness caused by messages published during a disconnect is
// covered by `state::config_poller`'s epoch drift detection.
if !config.nats_url.is_empty() {
@@ -313,8 +313,9 @@ async fn run_server(cfg: Config) -> Result<(), Box<dyn std::error::Error>> {
// worker-sidecar queue path so the registry receives queue pool names and
// bundle config hashes from `sie.health.>` heartbeats.
//
- // Core NATS subscriptions are resumed by the client on reconnect; do not spawn
- // duplicate `NatsHealthManager::start` loops on `reconnect_notify` (see PR review).
+ // Core NATS subscriptions normally resume on reconnect. The health manager
+ // also supervises a terminated `sie.health.>` stream and resubscribes from
+ // inside its own task, so do not spawn duplicate `start` loops here.
let mut ws_manager: Option<Arc<WsHealthManager>> = None;
let mut nats_health_manager: Option<Arc<NatsHealthManager>> = None;
let mut use_ws = true;
diff --git a/packages/sie_sdk/pyproject.toml b/packages/sie_sdk/pyproject.toml
index 2b1084cd5..b7683ac6f 100644
--- a/packages/sie_sdk/pyproject.toml
+++ b/packages/sie_sdk/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-sdk"
-version = "0.6.3"
+version = "0.6.4"
description = "Search Inference Engine - Python SDK"
requires-python = ">=3.12"
license = { text = "Apache-2.0" }
diff --git a/packages/sie_server/openapi.json b/packages/sie_server/openapi.json
index a26b423e1..4b246e3ef 100644
--- a/packages/sie_server/openapi.json
+++ b/packages/sie_server/openapi.json
@@ -3,7 +3,7 @@
"info": {
"title": "SIE Server",
"description": "Search Inference Engine - GPU inference server for search workloads",
- "version": "0.6.3"
+ "version": "0.6.4"
},
"paths": {
"/": {
diff --git a/packages/sie_server/pyproject.toml b/packages/sie_server/pyproject.toml
index 8971876ca..7a6e3374e 100644
--- a/packages/sie_server/pyproject.toml
+++ b/packages/sie_server/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "sie-server"
-version = "0.6.3"
+version = "0.6.4"
description = "Search Inference Engine - GPU inference server for search workloads"
requires-python = ">=3.12,<3.13"
license = { text = "Apache-2.0" }
diff --git a/packages/sie_server/src/sie_server/_ipc_test_harness.py b/packages/sie_server/src/sie_server/_ipc_test_harness.py
index e51b5e044..166f4ea68 100644
--- a/packages/sie_server/src/sie_server/_ipc_test_harness.py
+++ b/packages/sie_server/src/sie_server/_ipc_test_harness.py
@@ -136,7 +136,7 @@ class _StubExecutor:
async def process_extract_batch(self, req: ProcessExtractBatchRequest) -> BatchOutcome:
await self._maybe_sleep()
- return _canned_batch_outcome(req.items)
+ return _canned_extract_batch_outcome(req.items)
class _FakeGenerateProcessor:
@@ -179,6 +179,51 @@ def _canned_batch_outcome(items: list[Any]) -> BatchOutcome:
)
+def _extract_document_echo(item: Any) -> dict[str, Any]:
+ document = item.item.get("document") if isinstance(item.item, dict) else None
+ if not isinstance(document, dict):
+ return {
+ "present": False,
+ "data_is_bytes": False,
+ "data": b"",
+ "data_len": 0,
+ "format": None,
+ }
+
+ data = document.get("data")
+ data_is_bytes = isinstance(data, bytes | bytearray)
+ data_bytes = bytes(data) if data_is_bytes else b""
+ return {
+ "present": True,
+ "data_is_bytes": data_is_bytes,
+ "data": data_bytes,
+ "data_len": len(data_bytes),
+ "format": document.get("format"),
+ }
+
+
+def _canned_extract_batch_outcome(items: list[Any]) -> BatchOutcome:
+ outcomes: list[ItemOutcome] = []
+ for item in items:
+ payload = msgpack.packb(
+ {**_CANNED_RESULT, "extract_document": _extract_document_echo(item)},
+ use_bin_type=True,
+ )
+ outcomes.append(
+ ItemOutcome(
+ work_item_id=item.work_item_id,
+ request_id=item.request_id,
+ item_index=item.item_index,
+ disposition="publish_and_ack",
+ result_msgpack=payload,
+ inference_ms=0.1,
+ tokenization_ms=0.05,
+ postprocessing_ms=0.01,
+ )
+ )
+ return BatchOutcome(outcomes=outcomes)
+
+
def _canned_batch_outcome_echoing_prepared_tokens(items: list[Any]) -> BatchOutcome:
"""Like :func:`_canned_batch_outcome` but folds each item's
``prepared_tokens`` presence / content into the per-item
diff --git a/packages/sie_server_sidecar/Cargo.lock b/packages/sie_server_sidecar/Cargo.lock
index 71bc3f68b..ce2007adc 100644
--- a/packages/sie_server_sidecar/Cargo.lock
+++ b/packages/sie_server_sidecar/Cargo.lock
@@ -1916,6 +1916,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a4e1d4b9b938a26d2996af33229f0ca0956c652c1375067f0b45291c1df8417"
dependencies = [
"rmp",
+ "serde",
+ "serde_bytes",
]
[[package]]
@@ -2193,7 +2195,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
[[package]]
name = "sie-server-sidecar"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"anyhow",
"async-nats",
diff --git a/packages/sie_server_sidecar/Cargo.toml b/packages/sie_server_sidecar/Cargo.toml
index 9739e30e9..939ca39b5 100644
--- a/packages/sie_server_sidecar/Cargo.toml
+++ b/packages/sie_server_sidecar/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sie-server-sidecar"
-version = "0.6.3"
+version = "0.6.4"
edition = "2021"
description = "SIE worker sidecar: NATS JetStream consumer, scheduler, IPC client, and GPU-independent prep for sie-server pods."
@@ -32,6 +32,10 @@ rmp-serde = "1"
# `msgpack_numpy.patch()` decoder sees the same wire shape it gets
# from the Python adapters.
rmp = "0.8"
+# Dynamically typed msgpack values for request payloads. User items may
+# contain msgpack bin/ext fields (documents, images, numpy sentinels) that
+# cannot round-trip through serde_json::Value.
+rmpv = { version = "1", features = ["with-serde"] }
clap = { version = "4", features = ["derive", "env"] }
thiserror = "2"
@@ -73,6 +77,3 @@ cloud-storage = ["dep:object_store", "dep:url"]
[dev-dependencies]
tempfile = "3"
-# Dynamically typed msgpack values for tests that need to walk
-# hand-rolled wire envelopes (e.g. dense-encode numpy sentinel).
-rmpv = "1"
diff --git a/packages/sie_server_sidecar/src/dispatcher.rs b/packages/sie_server_sidecar/src/dispatcher.rs
index 5080bc7b2..8ca29ea50 100644
--- a/packages/sie_server_sidecar/src/dispatcher.rs
+++ b/packages/sie_server_sidecar/src/dispatcher.rs
@@ -18,6 +18,7 @@ use std::time::Instant;
use async_nats::jetstream::Message;
use futures_util::future::join_all;
+use rmpv::Value as MsgValue;
use serde_json::Value as Json;
use thiserror::Error;
use tokio::sync::{Mutex, Semaphore};
@@ -91,6 +92,32 @@ pub(crate) fn nak_delay_for_backend_error(err: &BackendError) -> u64 {
/// arbitrary subject. Empty reply_subjects are allowed (fire-and-forget).
const INBOX_PREFIX: &str = "_INBOX.";
+fn msg_value_key_eq(key: &MsgValue, expected: &str) -> bool {
+ match key {
+ MsgValue::String(s) => s.as_str() == Some(expected),
+ MsgValue::Binary(b) => std::str::from_utf8(b).ok() == Some(expected),
+ _ => false,
+ }
+}
+
+fn msg_map_get<'a>(value: &'a MsgValue, key: &str) -> Option<&'a MsgValue> {
+ let MsgValue::Map(entries) = value else {
+ return None;
+ };
+ entries
+ .iter()
+ .find(|(k, _)| msg_value_key_eq(k, key))
+ .map(|(_, v)| v)
+}
+
+fn msg_as_str(value: &MsgValue) -> Option<&str> {
+ match value {
+ MsgValue::String(s) => s.as_str(),
+ MsgValue::Binary(b) => std::str::from_utf8(b).ok(),
+ _ => None,
+ }
+}
+
/// True if `reply_subject` is acceptable for use on a `WorkItem`.
/// Empty is allowed (fire-and-forget). Non-empty subjects must start
/// with `_INBOX.` so malicious producers can't redirect results.
@@ -896,7 +923,7 @@ impl Dispatcher {
.pull_batch_process_seconds
.with_label_values(&[&model_lbl, "encode"])
.start_timer();
- let mut resolved: Vec<(WorkItem, Message, Json, f64)> = Vec::with_capacity(items.len());
+ let mut resolved: Vec<(WorkItem, Message, MsgValue, f64)> = Vec::with_capacity(items.len());
for (wi, msg) in items {
let (item_json, fetch_ms) = match self.resolve_item(&wi).await {
Ok(v) => v,
@@ -1010,7 +1037,7 @@ impl Dispatcher {
.pull_batch_process_seconds
.with_label_values(&[&model_lbl, "score"])
.start_timer();
- let mut prepared: Vec<(WorkItem, Message, Json, Vec<Json>, f64)> =
+ let mut prepared: Vec<(WorkItem, Message, MsgValue, Vec<MsgValue>, f64)> =
Vec::with_capacity(items.len());
for (wi, msg) in items {
let (query, score_items, fetch_ms) = match self.resolve_score(&wi).await {
@@ -1126,7 +1153,7 @@ impl Dispatcher {
.pull_batch_process_seconds
.with_label_values(&[&model_lbl, "extract"])
.start_timer();
- let mut resolved: Vec<(WorkItem, Message, Json, f64)> = Vec::with_capacity(items.len());
+ let mut resolved: Vec<(WorkItem, Message, MsgValue, f64)> = Vec::with_capacity(items.len());
for (wi, msg) in items {
let (item_json, fetch_ms) = match self.resolve_item(&wi).await {
Ok(v) => v,
@@ -1729,7 +1756,7 @@ impl Dispatcher {
// -- payload resolution ----------------------------------------------
- async fn resolve_item(&self, wi: &WorkItem) -> Result<(Json, f64), PayloadError> {
+ async fn resolve_item(&self, wi: &WorkItem) -> Result<(MsgValue, f64), PayloadError> {
if let Some(item) = &wi.item {
return Ok((item.clone(), 0.0));
}
@@ -1742,7 +1769,7 @@ impl Dispatcher {
let start = std::time::Instant::now();
let bytes = self.payload_store.get(payload_ref).await?;
let ms = start.elapsed().as_secs_f64() * 1000.0;
- let item: Json = rmp_serde::from_slice(&bytes)
+ let item: MsgValue = rmp_serde::from_slice(&bytes)
.map_err(|e| PayloadError::InvalidRef(format!("decode payload: {e}")))?;
Ok((item, ms))
}
@@ -1755,7 +1782,7 @@ impl Dispatcher {
//
// 1. Registry has an entry for `model_id` (the adapter declared
// a tokeniser on `EnsureModelReady`).
- // 2. The `item` JSON payload has a populated string `text`
+ // 2. The msgpack-native `item` payload has a populated string `text`
// field. Image / audio / multimodal items fall through to
// Python as today.
//
@@ -1784,7 +1811,7 @@ impl Dispatcher {
&self,
model_id: &str,
wi: &WorkItem,
- item: &Json,
+ item: &MsgValue,
) -> Option<PreparedTokens> {
let entry = self.tokenizer_registry.get(model_id)?;
@@ -1793,9 +1820,8 @@ impl Dispatcher {
// string would tokenise to a 2-token `[CLS][SEP]` padding
// sequence — harmless but pure IPC overhead vs letting Python
// short-circuit on its own empty-text guard.
- let raw_text = item
- .get("text")
- .and_then(|v| v.as_str())
+ let raw_text = msg_map_get(item, "text")
+ .and_then(msg_as_str)
.filter(|s| !s.is_empty())?;
// Resolve per-request template overrides; fall back to the
@@ -1835,7 +1861,10 @@ impl Dispatcher {
Some(rag_to_wire(entry.tokenizer_id(), entry.max_seq_len(), rag))
}
- async fn resolve_score(&self, wi: &WorkItem) -> Result<(Json, Vec<Json>, f64), PayloadError> {
+ async fn resolve_score(
+ &self,
+ wi: &WorkItem,
+ ) -> Result<(MsgValue, Vec<MsgValue>, f64), PayloadError> {
// Inline path: both query + items provided on the WorkItem.
if let (Some(q), Some(items)) = (&wi.query_item, &wi.score_items) {
return Ok((q.clone(), items.clone(), 0.0));
@@ -1852,19 +1881,19 @@ impl Dispatcher {
let start = std::time::Instant::now();
let bytes = self.payload_store.get(ref_key).await?;
let ms = start.elapsed().as_secs_f64() * 1000.0;
- let decoded: Json = rmp_serde::from_slice(&bytes)
+ let decoded: MsgValue = rmp_serde::from_slice(&bytes)
.map_err(|e| PayloadError::InvalidRef(format!("decode score payload: {e}")))?;
- let query = decoded
- .get("query")
+ let query = msg_map_get(&decoded, "query")
.cloned()
.ok_or_else(|| PayloadError::InvalidRef("score payload missing 'query'".into()))?;
- let items = decoded
- .get("items")
- .and_then(|v| v.as_array())
- .cloned()
- .ok_or_else(|| {
- PayloadError::InvalidRef("score payload missing 'items' array".into())
- })?;
+ let items = match msg_map_get(&decoded, "items") {
+ Some(MsgValue::Array(items)) => items.clone(),
+ _ => {
+ return Err(PayloadError::InvalidRef(
+ "score payload missing 'items' array".into(),
+ ));
+ }
+ };
Ok((query, items, ms))
}
}
@@ -2723,6 +2752,10 @@ fn decode_offloaded_generate(bytes: &[u8]) -> Result<Json, rmp_serde::decode::Er
mod tests {
use super::*;
+ fn text_item(text: &str) -> MsgValue {
+ MsgValue::Map(vec![(MsgValue::from("text"), MsgValue::from(text))])
+ }
+
fn wi(request: &str, idx: u32, model: &str, op: &str) -> WorkItem {
WorkItem {
work_item_id: format!("{}.{}", request, idx),
@@ -2735,7 +2768,7 @@ mod tests {
engine: String::new(),
pool_name: "l4".into(),
machine_profile: String::new(),
- item: Some(serde_json::json!({"text": "x"})),
+ item: Some(text_item("x")),
payload_ref: None,
output_types: None,
instruction: None,
diff --git a/packages/sie_server_sidecar/src/protocol/ipc_types.rs b/packages/sie_server_sidecar/src/protocol/ipc_types.rs
index b4712d800..87046f0b3 100644
--- a/packages/sie_server_sidecar/src/protocol/ipc_types.rs
+++ b/packages/sie_server_sidecar/src/protocol/ipc_types.rs
@@ -18,6 +18,10 @@
use serde::{Deserialize, Serialize};
+/// User item payloads are msgpack-native so binary fields (`bin` / `ext`) can
+/// reach Python unchanged. Small config fields stay JSON-shaped.
+pub type WireValue = rmpv::Value;
+
pub const IPC_VERSION: u32 = 1;
pub const METHOD_PING: &str = "Ping";
@@ -547,7 +551,7 @@ pub struct EncodeBatchItem {
pub item_index: u32,
pub total_items: u32,
pub timestamp: f64,
- pub item: serde_json::Value,
+ pub item: WireValue,
#[serde(default)]
pub output_types: Option<Vec<String>>,
#[serde(default)]
@@ -587,8 +591,8 @@ pub struct ScoreBatchItem {
pub item_index: u32,
pub total_items: u32,
pub timestamp: f64,
- pub query_item: serde_json::Value,
- pub score_items: Vec<serde_json::Value>,
+ pub query_item: WireValue,
+ pub score_items: Vec<WireValue>,
#[serde(default)]
pub instruction: Option<String>,
#[serde(default)]
@@ -623,7 +627,7 @@ pub struct ExtractBatchItem {
pub item_index: u32,
pub total_items: u32,
pub timestamp: f64,
- pub item: serde_json::Value,
+ pub item: WireValue,
#[serde(default)]
pub labels: Option<Vec<String>>,
#[serde(default)]
@@ -849,6 +853,10 @@ pub struct DrainResponse {
mod tests {
use super::*;
+ fn text_item(text: &str) -> WireValue {
+ WireValue::Map(vec![(WireValue::from("text"), WireValue::from(text))])
+ }
+
#[test]
fn readiness_state_serde_matches_python_literal() {
// Python side uses Literal["ready","loading_started","loading_in_progress","retry_later"].
@@ -989,7 +997,7 @@ mod tests {
item_index: 0,
total_items: 1,
timestamp: 0.0,
- item: serde_json::json!({"text": "hello"}),
+ item: text_item("hello"),
output_types: Some(vec!["dense".into()]),
instruction: None,
is_query: false,
@@ -1004,6 +1012,94 @@ mod tests {
assert!(back.prepared_tokens.is_none());
}
+ #[test]
+ fn process_extract_batch_request_preserves_document_bytes() {
+ let pdf_bytes = b"%PDF-1.4 tiny".to_vec();
+ let req = ProcessExtractBatchRequest {
+ model_id: "docling".into(),
+ items: vec![ExtractBatchItem {
+ work_item_id: "r.0".into(),
+ request_id: "r".into(),
+ item_index: 0,
+ total_items: 1,
+ timestamp: 0.0,
+ item: WireValue::Map(vec![(
+ WireValue::from("document"),
+ WireValue::Map(vec![
+ (
+ WireValue::from("data"),
+ WireValue::Binary(pdf_bytes.clone()),
+ ),
+ (WireValue::from("format"), WireValue::from("pdf")),
+ ]),
+ )]),
+ labels: None,
+ output_schema: None,
+ instruction: None,
+ options: None,
+ profile_id: None,
+ bundle_config_hash: None,
+ payload_fetch_ms: 0.0,
+ }],
+ };
+
+ let bytes = rmp_serde::to_vec_named(&req).unwrap();
+ let decoded: rmpv::Value = rmp_serde::from_slice(&bytes).unwrap();
+ let rmpv::Value::Map(root) = decoded else {
+ panic!("request should be a msgpack map");
+ };
+ let items = root
+ .iter()
+ .find_map(|(key, value)| {
+ if matches!(key, rmpv::Value::String(s) if s.as_str() == Some("items")) {
+ Some(value)
+ } else {
+ None
+ }
+ })
+ .expect("items field");
+ let rmpv::Value::Array(items) = items else {
+ panic!("items should be an array");
+ };
+ let Some(rmpv::Value::Map(first)) = items.first() else {
+ panic!("first item should be a map");
+ };
+ let document = first
+ .iter()
+ .find_map(|(key, value)| {
+ if matches!(key, rmpv::Value::String(s) if s.as_str() == Some("item")) {
+ Some(value)
+ } else {
+ None
+ }
+ })
+ .and_then(|item| match item {
+ rmpv::Value::Map(fields) => fields.iter().find_map(|(key, value)| {
+ if matches!(key, rmpv::Value::String(s) if s.as_str() == Some("document")) {
+ Some(value)
+ } else {
+ None
+ }
+ }),
+ _ => None,
+ })
+ .expect("document field");
+ let rmpv::Value::Map(document) = document else {
+ panic!("document should be a map");
+ };
+ let data = document
+ .iter()
+ .find_map(|(key, value)| {
+ if matches!(key, rmpv::Value::String(s) if s.as_str() == Some("data")) {
+ Some(value)
+ } else {
+ None
+ }
+ })
+ .expect("document.data");
+ assert_eq!(data, &rmpv::Value::Binary(pdf_bytes));
+ }
+
#[test]
fn ping_response_decodes_from_minimal_map() {
let bytes = rmp_serde::to_vec_named(&serde_json::json!({
diff --git a/packages/sie_server_sidecar/src/scheduler/item.rs b/packages/sie_server_sidecar/src/scheduler/item.rs
index c01e55148..8cd5fb317 100644
--- a/packages/sie_server_sidecar/src/scheduler/item.rs
+++ b/packages/sie_server_sidecar/src/scheduler/item.rs
@@ -74,8 +74,7 @@ fn cost_from_prepared(pt: Option<&PreparedTokens>) -> u64 {
/// [`crate::ipc_types::RunBatchRequest`] is O(items) moves and zero re-serialisation.
///
/// Named `SchedulerItem` rather than `Item` to avoid collision with
-/// the `item: serde_json::Value` field that lives inside the inner
-/// variants.
+/// the msgpack-native `item` fields that live inside the inner variants.
#[derive(Debug, Clone)]
pub enum SchedulerItem {
Encode(EncodeBatchItem),
@@ -219,6 +218,12 @@ pub fn lora_from_options(options: &Option<serde_json::Value>) -> LoraKey {
mod tests {
use super::*;
+ use crate::ipc_types::WireValue;
+
+ fn text_item(text: &str) -> WireValue {
+ WireValue::Map(vec![(WireValue::from("text"), WireValue::from(text))])
+ }
+
fn pt_with_lens(lens: &[usize]) -> PreparedTokens {
let input_ids: Vec<Vec<u32>> = lens
.iter()
@@ -240,7 +245,7 @@ mod tests {
item_index: idx,
total_items: 1,
timestamp: 0.0,
- item: serde_json::json!({"text": "x"}),
+ item: text_item("x"),
output_types: None,
instruction: None,
is_query: false,
@@ -269,8 +274,8 @@ mod tests {
item_index: 0,
total_items: 1,
timestamp: 0.0,
- query_item: serde_json::json!({"text": "q"}),
- score_items: vec![serde_json::json!({"text": "d"})],
+ query_item: text_item("q"),
+ score_items: vec![text_item("d")],
instruction: None,
options: None,
profile_id: None,
@@ -304,7 +309,7 @@ mod tests {
item_index: 0,
total_items: 1,
timestamp: 0.0,
- item: serde_json::json!({"text": "x"}),
+ item: text_item("x"),
labels: None,
output_schema: None,
instruction: None,
@@ -332,7 +337,7 @@ mod tests {
item_index: 0,
total_items: 1,
timestamp: 0.0,
- query_item: serde_json::json!(null),
+ query_item: WireValue::Nil,
score_items: vec![],
instruction: None,
options: None,
@@ -347,7 +352,7 @@ mod tests {
item_index: 0,
total_items: 1,
timestamp: 0.0,
- item: serde_json::json!(null),
+ item: WireValue::Nil,
labels: None,
output_schema: None,
instruction: None,
diff --git a/packages/sie_server_sidecar/src/work_types.rs b/packages/sie_server_sidecar/src/work_types.rs
index 44e2fc3d8..6fefbb9dc 100644
--- a/packages/sie_server_sidecar/src/work_types.rs
+++ b/packages/sie_server_sidecar/src/work_types.rs
@@ -8,6 +8,11 @@
use serde::{Deserialize, Serialize};
+/// User-supplied item payload carried as msgpack. Do not convert this to
+/// `serde_json::Value`: msgpack `bin` / `ext` fields are valid for documents,
+/// images, and numpy payloads, but JSON has no representation for them.
+pub type WireValue = rmpv::Value;
+
/// Work item pulled from JetStream. Must stay wire-compatible with the
/// gateway publisher.
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -32,7 +37,7 @@ pub struct WorkItem {
pub pool_name: String,
pub machine_profile: String,
#[serde(default)]
- pub item: Option<serde_json::Value>,
+ pub item: Option<WireValue>,
#[serde(default)]
pub payload_ref: Option<String>,
#[serde(default)]
@@ -44,11 +49,11 @@ pub struct WorkItem {
#[serde(default)]
pub options: Option<serde_json::Value>,
#[serde(default)]
- pub query_item: Option<serde_json::Value>,
+ pub query_item: Option<WireValue>,
#[serde(default)]
pub query_payload_ref: Option<String>,
#[serde(default)]
- pub score_items: Option<Vec<serde_json::Value>>,
+ pub score_items: Option<Vec<WireValue>>,
#[serde(default)]
pub labels: Option<Vec<String>>,
#[serde(default)]
@@ -108,6 +113,11 @@ pub struct WorkResult {
mod tests {
use super::*;
+ fn msg_value(value: serde_json::Value) -> WireValue {
+ let bytes = rmp_serde::to_vec_named(&value).unwrap();
+ rmp_serde::from_slice(&bytes).unwrap()
+ }
+
fn sample_work_item() -> WorkItem {
WorkItem {
work_item_id: "req-1.0".into(),
@@ -120,7 +130,7 @@ mod tests {
engine: String::new(),
pool_name: "l4".into(),
machine_profile: "l4-spot".into(),
- item: Some(serde_json::json!({"text": "hello"})),
+ item: Some(msg_value(serde_json::json!({"text": "hello"}))),
payload_ref: None,
output_types: Some(vec!["dense".into()]),
instruction: None,
@@ -154,7 +164,10 @@ mod tests {
assert_eq!(back.operation, "encode");
assert_eq!(back.model_id, "BAAI/bge-m3");
assert_eq!(back.output_types, Some(vec!["dense".to_string()]));
- assert_eq!(back.item, Some(serde_json::json!({"text": "hello"})));
+ assert_eq!(
+ back.item,
+ Some(msg_value(serde_json::json!({"text": "hello"})))
+ );
}
#[test]
@@ -178,6 +191,47 @@ mod tests {
assert_eq!(back.payload_ref, Some("req-1_0.bin".into()));
}
+ #[test]
+ fn work_item_preserves_document_bytes() {
+ let mut item = sample_work_item();
+ let pdf_bytes = b"%PDF-1.4 tiny".to_vec();
+ item.operation = "extract".into();
+ item.model_id = "docling".into();
+ item.item = Some(WireValue::Map(vec![(
+ WireValue::from("document"),
+ WireValue::Map(vec![
+ (
+ WireValue::from("data"),
+ WireValue::Binary(pdf_bytes.clone()),
+ ),
+ (WireValue::from("format"), WireValue::from("pdf")),
+ ]),
+ )]));
+
+ let bytes = rmp_serde::to_vec_named(&item).unwrap();
+ let back: WorkItem = rmp_serde::from_slice(&bytes).unwrap();
+ let Some(WireValue::Map(fields)) = back.item else {
+ panic!("item should decode as msgpack map");
+ };
+ let Some((_, WireValue::Map(document))) = fields
+ .iter()
+ .find(|(key, _)| matches!(key, WireValue::String(s) if s.as_str() == Some("document")))
+ else {
+ panic!("document should decode as msgpack map");
+ };
+ let data = document
+ .iter()
+ .find_map(|(key, value)| {
+ if matches!(key, WireValue::String(s) if s.as_str() == Some("data")) {
+ Some(value)
+ } else {
+ None
+ }
+ })
+ .expect("document.data");
+ assert_eq!(data, &WireValue::Binary(pdf_bytes));
+ }
+
#[test]
fn work_result_roundtrip_named() {
let result = WorkResult {
diff --git a/packages/sie_server_sidecar/tests/integration_smoke.rs b/packages/sie_server_sidecar/tests/integration_smoke.rs
index 12cdca951..c2b032d56 100644
--- a/packages/sie_server_sidecar/tests/integration_smoke.rs
+++ b/packages/sie_server_sidecar/tests/integration_smoke.rs
@@ -40,6 +40,66 @@ use tokio::time::{sleep, timeout};
static SMOKE_TEST_SEMAPHORE: OnceLock<Arc<Semaphore>> = OnceLock::new();
+fn msg_value(value: serde_json::Value) -> rmpv::Value {
+ let bytes = rmp_serde::to_vec_named(&value).expect("msgpack encode fixture value");
+ rmp_serde::from_slice(&bytes).expect("msgpack decode fixture value")
+}
+
+fn text_item(text: impl Into<String>) -> rmpv::Value {
+ let text = text.into();
+ msg_value(serde_json::json!({ "text": text }))
+}
+
+fn document_item(data: Vec<u8>, format: &str) -> rmpv::Value {
+ rmpv::Value::Map(vec![(
+ rmpv::Value::from("document"),
+ rmpv::Value::Map(vec![
+ (rmpv::Value::from("data"), rmpv::Value::Binary(data)),
+ (rmpv::Value::from("format"), rmpv::Value::from(format)),
+ ]),
+ )])
+}
+
+fn msg_value_key_eq(key: &rmpv::Value, expected: &str) -> bool {
+ match key {
+ rmpv::Value::String(s) => s.as_str() == Some(expected),
+ rmpv::Value::Binary(b) => std::str::from_utf8(b).ok() == Some(expected),
+ _ => false,
+ }
+}
+
+fn msg_map_get<'a>(value: &'a rmpv::Value, key: &str) -> Option<&'a rmpv::Value> {
+ let rmpv::Value::Map(entries) = value else {
+ return None;
+ };
+ entries
+ .iter()
+ .find(|(k, _)| msg_value_key_eq(k, key))
+ .map(|(_, v)| v)
+}
+
+fn msg_as_bool(value: &rmpv::Value) -> Option<bool> {
+ match value {
+ rmpv::Value::Boolean(value) => Some(*value),
+ _ => None,
+ }
+}
+
+fn msg_as_str(value: &rmpv::Value) -> Option<&str> {
+ match value {
+ rmpv::Value::String(value) => value.as_str(),
+ rmpv::Value::Binary(value) => std::str::from_utf8(value).ok(),
+ _ => None,
+ }
+}
+
+fn msg_as_u64(value: &rmpv::Value) -> Option<u64> {
+ match value {
+ rmpv::Value::Integer(value) => value.as_u64(),
+ _ => None,
+ }
+}
+
async fn smoke_test_guard() -> OwnedSemaphorePermit {
SMOKE_TEST_SEMAPHORE
.get_or_init(|| Arc::new(Semaphore::new(1)))
@@ -616,7 +676,7 @@ async fn smoke_encode_request_round_trips_through_rust_worker() {
engine: String::new(),
pool_name: pool.into(),
machine_profile: pool.into(),
- item: Some(serde_json::json!({"text": "hello rust worker"})),
+ item: Some(text_item("hello rust worker")),
payload_ref: None,
output_types: Some(vec!["dense".into()]),
instruction: None,
@@ -1156,6 +1216,177 @@ async fn smoke_payload_ref_request_round_trips_through_rust_worker() {
sleep(Duration::from_millis(200)).await;
}
+/// Regression: document bytes must remain msgpack `bin` from the offloaded
+/// WorkItem payload through the Rust dispatcher and into the Python IPC item.
+#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
+async fn smoke_extract_payload_ref_preserves_document_bytes_through_ipc() {
+ if skip_unless_tools_available() {
+ return;
+ }
+ let _guard = smoke_test_guard().await;
+
+ let nats = NatsHarness::start().await;
+ eprintln!("nats: {} (port {})", nats.url, nats.port);
+
+ let sock = ShortSocket::new("ipc.sock");
+ let python = PythonHarness::start(sock.path.clone()).await;
+ eprintln!("python harness: socket={}", python.socket_path.display());
+
+ let payload_dir = tempfile::Builder::new()
+ .prefix("siews-doc-payloads-")
+ .tempdir_in("/tmp")
+ .expect("create payload dir");
+ let payload_store_url = payload_dir
+ .path()
+ .to_str()
+ .expect("payload dir utf-8")
+ .to_string();
+
+ let request_id = "smoke-doc-payload-ref-1";
+ let pdf_bytes = b"%PDF-1.4 tiny sidecar regression".to_vec();
+ let item_path = payload_dir.path().join(format!("{request_id}_0.bin"));
+ let item_body = document_item(pdf_bytes.clone(), "pdf");
+ let item_bytes = rmp_serde::to_vec_named(&item_body).expect("msgpack encode document item");
+ tokio::fs::write(&item_path, &item_bytes)
+ .await
+ .expect("write document payload");
+ let payload_ref = item_path.to_str().expect("payload path utf-8").to_string();
+ eprintln!(
+ "wrote document payload: {payload_ref} ({} bytes)",
+ item_bytes.len()
+ );
+
+ let pool = "smoke-doc";
+ let bundle = "default";
+ let metrics_port = find_free_tcp_port();
+ let _worker = WorkerHarness::spawn(
+ &nats.url,
+ &sock.path,
+ pool,
+ bundle,
+ metrics_port,
+ Some(&payload_store_url),
+ );
+ wait_for_tcp(metrics_port, Duration::from_secs(30))
+ .await
+ .expect("worker metrics port");
+ sleep(Duration::from_millis(500)).await;
+
+ let client = async_nats::connect(&nats.url)
+ .await
+ .expect("client connect");
+ let reply_subject = format!("_INBOX.smoke-doc.{}", uuid::Uuid::new_v4());
+ let mut sub = client
+ .subscribe(reply_subject.clone())
+ .await
+ .expect("subscribe reply");
+
+ let model_id = "docling";
+ let subject = pool_work_subject(pool, pool, bundle, model_id);
+ let now_s = std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .unwrap()
+ .as_secs_f64();
+ let work_item = WorkItem {
+ work_item_id: format!("{request_id}.0"),
+ request_id: request_id.into(),
+ item_index: 0,
+ total_items: 1,
+ operation: "extract".into(),
+ model_id: model_id.into(),
+ profile_id: String::new(),
+ engine: String::new(),
+ pool_name: pool.into(),
+ machine_profile: pool.into(),
+ item: None,
+ payload_ref: Some(payload_ref.clone()),
+ output_types: None,
+ instruction: None,
+ is_query: false,
+ options: None,
+ query_item: None,
+ query_payload_ref: None,
+ score_items: None,
+ labels: Some(vec!["document".into()]),
+ output_schema: None,
+ generate: None,
+ routing_key: None,
+ prompt_cache_key: None,
+ bundle_config_hash: String::new(),
+ router_id: "smoke-gw".into(),
+ reply_subject: reply_subject.clone(),
+ traceparent: None,
+ tracestate: None,
+ timestamp: now_s,
+ };
+ let payload = rmp_serde::to_vec_named(&work_item).expect("encode extract WorkItem");
+ let js = async_nats::jetstream::new(client.clone());
+ let (stream, sequence) = publish_jetstream_with_retry(&js, &subject, payload).await;
+ eprintln!(
+ "published document payload-ref WorkItem, stream={} seq={}",
+ stream, sequence
+ );
+
+ let reply = timeout(Duration::from_secs(30), sub.next())
+ .await
+ .expect("timed out waiting for extract WorkResult")
+ .expect("reply stream closed");
+ let result: WorkResult = rmp_serde::from_slice(&reply.payload).expect("decode WorkResult");
+ assert!(
+ result.success,
+ "expected success, got error={:?}",
+ result.error
+ );
+ assert_eq!(result.request_id, request_id);
+ assert_eq!(result.work_item_id, format!("{request_id}.0"));
+
+ let echo: rmpv::Value =
+ rmp_serde::from_slice(&result.result_msgpack).expect("decode extract echo");
+ assert_eq!(msg_map_get(&echo, "smoke").and_then(msg_as_str), Some("ok"));
+ assert_eq!(
+ msg_map_get(&echo, "source").and_then(msg_as_str),
+ Some("ipc_test_harness")
+ );
+ let document = msg_map_get(&echo, "extract_document").expect("extract_document echo");
+ assert_eq!(
+ msg_map_get(document, "present").and_then(msg_as_bool),
+ Some(true)
+ );
+ assert_eq!(
+ msg_map_get(document, "data_is_bytes").and_then(msg_as_bool),
+ Some(true),
+ "Python IPC harness did not receive document.data as bytes; echo={echo:?}",
+ );
+ assert_eq!(
+ msg_map_get(document, "data_len").and_then(msg_as_u64),
+ Some(pdf_bytes.len() as u64)
+ );
+ assert_eq!(
+ msg_map_get(document, "format").and_then(msg_as_str),
+ Some("pdf")
+ );
+ assert_eq!(
+ msg_map_get(document, "data"),
+ Some(&rmpv::Value::Binary(pdf_bytes)),
+ "document.data changed before reaching Python IPC; echo={echo:?}",
+ );
+
+ let fetch_ms = result
+ .payload_fetch_ms
+ .expect("payload_fetch_ms should be populated when item is offloaded");
+ assert!(
+ (0.0..5_000.0).contains(&fetch_ms),
+ "payload_fetch_ms out of expected range: {fetch_ms}"
+ );
+
+ drop(_worker);
+ drop(python);
+ drop(nats);
+ let _ = sock;
+ let _ = payload_dir;
+ sleep(Duration::from_millis(200)).await;
+}
+
// ---------------------------------------------------------------------------
// Concurrent / stress scenarios for the pull loop
//
@@ -1249,7 +1480,7 @@ async fn publish_work_item(
engine: String::new(),
pool_name: pool.into(),
machine_profile: pool.into(),
- item: Some(serde_json::json!({"text": format!("concurrent-{request_id}")})),
+ item: Some(text_item(format!("concurrent-{request_id}"))),
payload_ref: None,
output_types: Some(vec!["dense".into()]),
instruction: None,
@@ -1949,7 +2180,7 @@ async fn smoke_prepared_tokens_round_trip_through_rust_worker() {
engine: String::new(),
pool_name: pool.into(),
machine_profile: pool.into(),
- item: Some(serde_json::json!({"text": "hello world"})),
+ item: Some(text_item("hello world")),
payload_ref: None,
output_types: Some(vec!["dense".into()]),
instruction: None,
@@ -2131,9 +2362,9 @@ async fn publish_score_work_item(
instruction: None,
is_query: false,
options: None,
- query_item: Some(serde_json::json!({"text": "what is the capital of France?"})),
+ query_item: Some(text_item("what is the capital of France?")),
query_payload_ref: None,
- score_items: Some(vec![serde_json::json!({"text": "Paris is the capital."})]),
+ score_items: Some(vec![text_item("Paris is the capital.")]),
labels: None,
output_schema: None,
generate: None,
@@ -2175,7 +2406,7 @@ async fn publish_extract_work_item(
engine: String::new(),
pool_name: pool.into(),
machine_profile: pool.into(),
- item: Some(serde_json::json!({"text": "Barack Obama was born in Hawaii."})),
+ item: Some(text_item("Barack Obama was born in Hawaii.")),
payload_ref: None,
output_types: None,
instruction: None,
diff --git a/packages/sie_ts_sdk/package.json b/packages/sie_ts_sdk/package.json
index 2b24f5c62..a06b2db44 100644
--- a/packages/sie_ts_sdk/package.json
+++ b/packages/sie_ts_sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@superlinked/sie-sdk",
- "version": "0.6.3",
+ "version": "0.6.4",
"description": "Official TypeScript SDK for SIE (Search Inference Engine)",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/packages/sie_ts_sdk/src/version.ts b/packages/sie_ts_sdk/src/version.ts
index d25623a30..45d40d236 100644
--- a/packages/sie_ts_sdk/src/version.ts
+++ b/packages/sie_ts_sdk/src/version.ts
@@ -1 +1 @@
-export const SDK_VERSION = "0.6.3"; // x-release-please-version
+export const SDK_VERSION = "0.6.4"; // x-release-please-version
diff --git a/uv.lock b/uv.lock
index c2ee4862b..40574d463 100644
--- a/uv.lock
+++ b/uv.lock
@@ -5671,7 +5671,7 @@ dev = [
[[package]]
name = "sie-admin"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "packages/sie_admin" }
dependencies = [
{ name = "httpx" },
@@ -5704,7 +5704,7 @@ requires-dist = [
[[package]]
name = "sie-bench"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "packages/sie_bench" }
dependencies = [
{ name = "aiohttp" },
@@ -5789,7 +5789,7 @@ requires-dist = [
[[package]]
name = "sie-chroma"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_chroma" }
dependencies = [
{ name = "chromadb" },
@@ -5861,7 +5861,7 @@ dev = [
[[package]]
name = "sie-crewai"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_crewai" }
dependencies = [
{ name = "crewai" },
@@ -5886,7 +5886,7 @@ requires-dist = [
[[package]]
name = "sie-dspy"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_dspy" }
dependencies = [
{ name = "dspy" },
@@ -5911,7 +5911,7 @@ requires-dist = [
[[package]]
name = "sie-haystack"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_haystack" }
dependencies = [
{ name = "haystack-ai" },
@@ -5938,7 +5938,7 @@ requires-dist = [
[[package]]
name = "sie-lancedb"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_lancedb" }
dependencies = [
{ name = "lancedb" },
@@ -5965,7 +5965,7 @@ requires-dist = [
[[package]]
name = "sie-langchain"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_langchain" }
dependencies = [
{ name = "langchain-core" },
@@ -5992,7 +5992,7 @@ requires-dist = [
[[package]]
name = "sie-llamaindex"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_llamaindex" }
dependencies = [
{ name = "llama-index-core" },
@@ -6019,7 +6019,7 @@ requires-dist = [
[[package]]
name = "sie-qdrant"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_qdrant" }
dependencies = [
{ name = "qdrant-client" },
@@ -6042,7 +6042,7 @@ requires-dist = [
[[package]]
name = "sie-sdk"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "packages/sie_sdk" }
dependencies = [
{ name = "aiohttp" },
@@ -6095,7 +6095,7 @@ requires-dist = [
[[package]]
name = "sie-server"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "packages/sie_server" }
dependencies = [
{ name = "blake3" },
@@ -6210,7 +6210,7 @@ dev = []
[[package]]
name = "sie-weaviate"
-version = "0.6.3"
+version = "0.6.4"
source = { editable = "integrations/sie_weaviate" }
dependencies = [
{ name = "sie-sdk" },