From f764790970641e2df659f622aae1e4f22fa6b39e Mon Sep 17 00:00:00 2001 From: Hazel Date: Mon, 29 Sep 2025 11:03:04 -0700 Subject: [PATCH 1/4] Replace stargate.jsonapi to data-api --- CONFIGURATION.md | 72 +- README.md | 6 +- docker-compose/README.md | 4 +- .../configuration/TenantConfiguration.java | 12 +- .../DataApiTokenConfiguration.java | 8 +- .../HeaderBasedSecurityConfiguration.java | 4 +- .../api/v1/metrics/JsonApiMetricsConfig.java | 2 +- .../jsonapi/api/v1/metrics/MetricsConfig.java | 4 +- .../sgv2/jsonapi/config/AuthConfig.java | 4 +- .../config/CommandLevelLoggingConfig.java | 2 +- .../jsonapi/config/DatabaseLimitsConfig.java | 2 +- .../sgv2/jsonapi/config/DebugModeConfig.java | 2 +- .../jsonapi/config/DocumentLimitsConfig.java | 2 +- .../jsonapi/config/MultiTenancyConfig.java | 2 +- .../sgv2/jsonapi/config/OperationsConfig.java | 2 +- .../config/constants/HttpConstants.java | 2 +- .../config/feature/FeaturesConfig.java | 6 +- .../DefaultEmbeddingProviderConfig.java | 2 +- .../EmbeddingProvidersConfig.java | 2 +- .../CreateCollectionOperation.java | 2 +- .../DefaultRerankingProviderConfig.java | 2 +- src/main/resources/application.yaml | 2 +- .../resources/embedding-providers-config.yaml | 917 +++++++++--------- .../resources/reranking-providers-config.yaml | 33 +- .../command/impl/InsertManyCommandTest.java | 2 +- .../EmbeddingClientTestResource.java | 4 +- .../PropertyBasedOverrideProfile.java | 12 +- ...erialConsistencyOverrideOperationTest.java | 2 +- .../resolver/DisableVectorizeProfile.java | 2 +- .../resolver/EnabledVectorizeProfile.java | 2 +- .../jsonapi/testresource/DseTestResource.java | 33 +- .../testresource/StargateTestResource.java | 15 +- 32 files changed, 580 insertions(+), 588 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index b705398cda..51c0b4c0fa 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -13,46 +13,46 @@ Other Quarkus properties that are specifically relevant for the service: | Property | Type | Default | Description | |-----------------------------------------------------------|-------|---------|---------------------------------------------------------------------------------------------------| -| `stargate.database.limits.max-collections` | `int` | `5` | The maximum number of Collections allowed to be created per Database. | -| `stargate.database.limits.indexes-needed-per-collection` | `int` | `10` | Number of indexes needed per Collection (to determine if a new Collection may be added). | -| `stargate.database.limits.indexes-available-per-database` | `int` | `50` | Number of indexes assumed to be available per Database (to determine if Collection may be added). | +| `data-api.database.limits.max-collections` | `int` | `5` | The maximum number of Collections allowed to be created per Database. | +| `data-api.database.limits.indexes-needed-per-collection` | `int` | `10` | Number of indexes needed per Collection (to determine if a new Collection may be added). | +| `data-api.database.limits.indexes-available-per-database` | `int` | `50` | Number of indexes assumed to be available per Database (to determine if Collection may be added). | ## Document limits configuration *Configuration for document limits, defined by [DocumentLimitsConfig.java](src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java).* | Property | Type | Default | Description | |-----------------------------------------------------------------|-------|-------------|-----------------------------------------------------------------------------------------| -| `stargate.jsonapi.document.limits.max-size` | `int` | `4_000_000` | The maximum size of (in characters) a single document. | -| `stargate.jsonapi.document.limits.max-depth` | `int` | `16` | The maximum document depth (nesting). | -| `stargate.jsonapi.document.limits.max-property-path-length` | `int` | `1000` | The maximum length of property paths in a document (segments and separating periods) | -| `stargate.jsonapi.document.limits.max-object-properties` | `int` | `1000` | The maximum number of properties any single indexable object in a document can contain. | -| `stargate.jsonapi.document.limits.max-document-properties` | `int` | `2000` | The maximum number of total indexed properties a document can contain. | -| `stargate.jsonapi.document.limits.max-number-length` | `int` | `100` | The maximum length (in characters) of a single number value in a document. | -| `stargate.jsonapi.document.limits.max-string-length-in-bytes` | `int` | `8000` | The maximum length (in bytes) of a single indexable string value in a document. | -| `stargate.jsonapi.document.limits.max-array-length` | `int` | `1000` | The maximum length (in elements) of a single indexable array in a document. | -| `stargate.jsonapi.document.limits.max-vector-embedding-length` | `int` | `4096` | The maximum length (in floats) of the $vector in a document. | +| `data-api.document.limits.max-size` | `int` | `4_000_000` | The maximum size of (in characters) a single document. | +| `data-api.document.limits.max-depth` | `int` | `16` | The maximum document depth (nesting). | +| `data-api.document.limits.max-property-path-length` | `int` | `1000` | The maximum length of property paths in a document (segments and separating periods) | +| `data-api.document.limits.max-object-properties` | `int` | `1000` | The maximum number of properties any single indexable object in a document can contain. | +| `data-api.document.limits.max-document-properties` | `int` | `2000` | The maximum number of total indexed properties a document can contain. | +| `data-api.document.limits.max-number-length` | `int` | `100` | The maximum length (in characters) of a single number value in a document. | +| `data-api.document.limits.max-string-length-in-bytes` | `int` | `8000` | The maximum length (in bytes) of a single indexable string value in a document. | +| `data-api.document.limits.max-array-length` | `int` | `1000` | The maximum length (in elements) of a single indexable array in a document. | +| `data-api.document.limits.max-vector-embedding-length` | `int` | `4096` | The maximum length (in floats) of the $vector in a document. | ## Operations configuration *Configuration for the operation execution, defined by [OperationsConfig.java](src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java).* | Property | Type | Default | Description | |-------------------------------------------------------------------------|-----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `stargate.jsonapi.operations.default-page-size` | `int` | `20` | The default Cassandra page size used for read queries. | -| `stargate.jsonapi.operations.default-sort-page-size` | `int` | `100` | The default Cassandra page size used for read queries that are used for sorting purposes. | -| `stargate.jsonapi.operations.max-document-sort-count` | `int` | `10_000` | The maximum amount of documents that could be sorted using the in-memory sorting. The request will fail in case in-memory sorting would break the limit. | -| `stargate.jsonapi.operations.max-document-insert-count` | `int` | `20` | The maximum amount of documents that can be inserted in a single operation. The request will fail fast without inserts if the limit is broken. | -| `stargate.jsonapi.operations.max-document-update-count` | `int` | `20` | The maximum amount of documents that can be updated in a single operation. In case there are more documents that could be updated, the operation will set the `moreData` response status to `true`. | -| `stargate.jsonapi.operations.max-document-delete-count` | `int` | `20` | The maximum amount of documents that can be deleted in a single operation. In case there are more documents that could be deleted, the operation will set the `moreData` response status to `true`. | -| `stargate.jsonapi.operations.max-filter-object-properties` | `int` | `64` | The maximum number of properties a single filter clause can contain. | -| `stargate.jsonapi.operations.max-in-operator-value-size` | `int` | `100` | The maximum number of _id values that can be passed for `$in` operator. | -| `stargate.jsonapi.operations.lwt.retries` | `int` | `3` | The amount of client side retries in case of a LWT failure. | -| `stargate.jsonapi.operations.database-config.session-cache-ttl-seconds` | `int` | `300` | The amount of seconds that the cql session will be kept in memory after last access. | -| `stargate.jsonapi.operations.database-config.session-cache-max-size` | `int` | `50` | The maximum number of cql sessions that will be kept in memory. | -| `stargate.jsonapi.operations.default-count-page-size` | `int` | `100` | The default Cassandra page size used for reading keys for count command. | -| `stargate.jsonapi.operations.max-count-limit` | `int` | `1000` | The default maximum number of rows to read for count operation. | -| `stargate.jsonapi.operations.database-config.ddl-retry-delay-millis` | `int` | `1000` | Delay time in seconds for DDL timeout. | -| `stargate.jsonapi.operations.database-config.ddl-delay-millis` | `int` | `2000` | Delay between create table and create index to get the schema sync. | -| `stargate.jsonapi.operations.vectorize-enabled` | `boolean` | `false` | Flag to enable server side vectorization. | +| `data-api.operations.default-page-size` | `int` | `20` | The default Cassandra page size used for read queries. | +| `data-api.operations.default-sort-page-size` | `int` | `100` | The default Cassandra page size used for read queries that are used for sorting purposes. | +| `data-api.operations.max-document-sort-count` | `int` | `10_000` | The maximum amount of documents that could be sorted using the in-memory sorting. The request will fail in case in-memory sorting would break the limit. | +| `data-api.operations.max-document-insert-count` | `int` | `20` | The maximum amount of documents that can be inserted in a single operation. The request will fail fast without inserts if the limit is broken. | +| `data-api.operations.max-document-update-count` | `int` | `20` | The maximum amount of documents that can be updated in a single operation. In case there are more documents that could be updated, the operation will set the `moreData` response status to `true`. | +| `data-api.operations.max-document-delete-count` | `int` | `20` | The maximum amount of documents that can be deleted in a single operation. In case there are more documents that could be deleted, the operation will set the `moreData` response status to `true`. | +| `data-api.operations.max-filter-object-properties` | `int` | `64` | The maximum number of properties a single filter clause can contain. | +| `data-api.operations.max-in-operator-value-size` | `int` | `100` | The maximum number of _id values that can be passed for `$in` operator. | +| `data-api.operations.lwt.retries` | `int` | `3` | The amount of client side retries in case of a LWT failure. | +| `data-api.operations.database-config.session-cache-ttl-seconds` | `int` | `300` | The amount of seconds that the cql session will be kept in memory after last access. | +| `data-api.operations.database-config.session-cache-max-size` | `int` | `50` | The maximum number of cql sessions that will be kept in memory. | +| `data-api.operations.default-count-page-size` | `int` | `100` | The default Cassandra page size used for reading keys for count command. | +| `data-api.operations.max-count-limit` | `int` | `1000` | The default maximum number of rows to read for count operation. | +| `data-api.operations.database-config.ddl-retry-delay-millis` | `int` | `1000` | Delay time in seconds for DDL timeout. | +| `data-api.operations.database-config.ddl-delay-millis` | `int` | `2000` | Delay between create table and create index to get the schema sync. | +| `data-api.operations.vectorize-enabled` | `boolean` | `false` | Flag to enable server side vectorization. | ## Jsonapi metering configuration @@ -60,10 +60,10 @@ Other Quarkus properties that are specifically relevant for the service: | Property | Type | Default | Description | |---------------------------------------|----------|---------------|--------------------------------------------------------------| -| `stargate.jsonapi.metric.error-class` | `string` | `error.class` | Metrics tag that provides information about the error class. | -| `stargate.jsonapi.metric.error-code` | `string` | `error.code` | Metrics tag that provides information about the error code. | -| `stargate.jsonapi.metric.command` | `string` | `command` | Metrics tag that provides information about the command. | -| `stargate.jsonapi.metric.metrics.name`| `string` | `jsonapi` | Metrics name prefix. | +| `data-api.metric.error-class` | `string` | `error.class` | Metrics tag that provides information about the error class. | +| `data-api.metric.error-code` | `string` | `error.code` | Metrics tag that provides information about the error code. | +| `data-api.metric.command` | `string` | `command` | Metrics tag that provides information about the command. | +| `data-api.metric.metrics.name`| `string` | `jsonapi` | Metrics name prefix. | ## Command level logging configuration @@ -71,13 +71,13 @@ Other Quarkus properties that are specifically relevant for the service: | Property | Type | Default | Description | |-----------------------------------------------------|-----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `stargate.jsonapi.logging.enabled` | `boolean` | `false` | Setting it to `true` enables command level logging. | -| `stargate.jsonapi.logging.only-results-with-errors` | `boolean` | `true` | Setting it to `true` prints the command level info only for the commands where the command result has errors. | -| `stargate.jsonapi.logging.enabled-tenants` | `string` | `ALL` | Comma separated list of tenants for which command level logging should be enabled. Default is a special keyword called `ALL` which prints this log for all tenants | +| `data-api.logging.enabled` | `boolean` | `false` | Setting it to `true` enables command level logging. | +| `data-api.logging.only-results-with-errors` | `boolean` | `true` | Setting it to `true` prints the command level info only for the commands where the command result has errors. | +| `data-api.logging.enabled-tenants` | `string` | `ALL` | Comma separated list of tenants for which command level logging should be enabled. Default is a special keyword called `ALL` which prints this log for all tenants | ## API Feature enabling configuration *Configuration for enabling Features, defined by [FeaturesConfig.java](src/main/java/io/stargate/sgv2/jsonapi/config/CommandLoggingConfig.java).* | Property | Type | Default | Description | |---------------------------------|-----------|---------|---------------------------------------------------------------------------------------------------------------------| -| `stargate.feature.flags.tables` | `boolean` | `null` | Setting it to `true` enables Tables functionality; `false` disables; leaving as `null` allows per-request override.| +| `data-api.feature.flags.tables` | `boolean` | `null` | Setting it to `true` enables Tables functionality; `false` disables; leaving as `null` allows per-request override.| diff --git a/README.md b/README.md index 6659a5897b..51cb30a779 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ You can run your application in dev mode that enables live coding using: ```shell script docker run -d --rm -e CLUSTER_NAME=dse-cluster -e CLUSTER_VERSION=6.8 -e ENABLE_AUTH=true -e DEVELOPER_MODE=true -e DS_LICENSE=accept -e DSE=true -p 8081:8081 -p 8091:8091 -p 9042:9042 stargateio/coordinator-dse-next:v2 -./mvnw compile quarkus:dev -Dstargate.jsonapi.operations.vectorize-enabled=true \ - -Dstargate.jsonapi.operations.database-config.local-datacenter=dc1 +./mvnw compile quarkus:dev -Ddata-api.operations.vectorize-enabled=true \ + -Ddata-api.operations.database-config.local-datacenter=dc1 ``` The command above will first spin the single Stargate DSE coordinator in dev that the API would communicate to. @@ -254,5 +254,5 @@ We regularly update the integration tests and [Docker compose](docker-compose) s ``` - The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. Set the correct `local-datacenter` as the jvm option. ``` - java -Dstargate.jsonapi.operations.database-config.local-datacenter=dc1 -jar target/quarkus-app/quarkus-run.jar + java -Ddata-api.operations.database-config.local-datacenter=dc1 -jar target/quarkus-app/quarkus-run.jar ``` diff --git a/docker-compose/README.md b/docker-compose/README.md index ca03a5f279..f50a52936e 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -77,8 +77,8 @@ To run locally built Data API in Quarkus Development mode, you will use: ``` /mvnw compile quarkus:dev -Dstargate.data-store.ignore-bridge=true \ - -Dstargate.jsonapi.operations.vectorize-enabled=true \ - -Dstargate.jsonapi.operations.database-config.local-datacenter=dc1 + -Ddata-api.operations.vectorize-enabled=true \ + -Ddata-api.operations.database-config.local-datacenter=dc1 ``` ## Script options diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/request/tenant/configuration/TenantConfiguration.java b/src/main/java/io/stargate/sgv2/jsonapi/api/request/tenant/configuration/TenantConfiguration.java index 2fcb056662..fcd610fa4a 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/request/tenant/configuration/TenantConfiguration.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/request/tenant/configuration/TenantConfiguration.java @@ -31,16 +31,16 @@ public class TenantConfiguration { @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.multi-tenancy.tenant-resolver.type", stringValue = "subdomain") - @LookupIfProperty(name = "stargate.multi-tenancy.enabled", stringValue = "true") + @LookupIfProperty(name = "data-api.multi-tenancy.tenant-resolver.type", stringValue = "subdomain") + @LookupIfProperty(name = "data-api.multi-tenancy.enabled", stringValue = "true") DataApiTenantResolver subdomainTenantResolver(MultiTenancyConfig config) { return new SubdomainTenantResolver(config.tenantResolver().subdomain()); } @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.multi-tenancy.tenant-resolver.type", stringValue = "fixed") - @LookupIfProperty(name = "stargate.multi-tenancy.enabled", stringValue = "true") + @LookupIfProperty(name = "data-api.multi-tenancy.tenant-resolver.type", stringValue = "fixed") + @LookupIfProperty(name = "data-api.multi-tenancy.enabled", stringValue = "true") DataApiTenantResolver fixedTenantResolver(MultiTenancyConfig config) { return new FixedTenantResolver(config.tenantResolver().fixed()); } @@ -48,11 +48,11 @@ DataApiTenantResolver fixedTenantResolver(MultiTenancyConfig config) { @Produces @ApplicationScoped @LookupIfProperty( - name = "stargate.multi-tenancy.tenant-resolver.type", + name = "data-api.multi-tenancy.tenant-resolver.type", stringValue = "noop", lookupIfMissing = true) @LookupIfProperty( - name = "stargate.multi-tenancy.enabled", + name = "data-api.multi-tenancy.enabled", stringValue = "false", lookupIfMissing = true) DataApiTenantResolver noopTenantResolver() { diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/request/token/configuration/DataApiTokenConfiguration.java b/src/main/java/io/stargate/sgv2/jsonapi/api/request/token/configuration/DataApiTokenConfiguration.java index f87b0237dd..133c1e67bd 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/request/token/configuration/DataApiTokenConfiguration.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/request/token/configuration/DataApiTokenConfiguration.java @@ -32,7 +32,7 @@ public class DataApiTokenConfiguration { @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "header") + @LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "header") DataApiTokenResolver headerTokenResolver(AuthConfig config) { String headerName = config.tokenResolver().header().headerName(); return new HeaderTokenResolver(headerName); @@ -40,14 +40,14 @@ DataApiTokenResolver headerTokenResolver(AuthConfig config) { @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "principal") + @LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "principal") DataApiTokenResolver principalTokenResolver() { return new PrincipalTokenResolver(); } @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "fixed") + @LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "fixed") DataApiTokenResolver fixedTokenResolver(AuthConfig config) { return new FixedTokenResolver(config.tokenResolver().fixed()); } @@ -55,7 +55,7 @@ DataApiTokenResolver fixedTokenResolver(AuthConfig config) { @Produces @ApplicationScoped @LookupIfProperty( - name = "stargate.auth.token-resolver.type", + name = "data-api.auth.token-resolver.type", stringValue = "noop", lookupIfMissing = true) DataApiTokenResolver noopCassandraTokenResolver() { diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/security/configuration/HeaderBasedSecurityConfiguration.java b/src/main/java/io/stargate/sgv2/jsonapi/api/security/configuration/HeaderBasedSecurityConfiguration.java index b72c75a02e..872dbd087a 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/security/configuration/HeaderBasedSecurityConfiguration.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/security/configuration/HeaderBasedSecurityConfiguration.java @@ -34,7 +34,7 @@ public class HeaderBasedSecurityConfiguration { @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.auth.header-based.enabled", stringValue = "true") + @LookupIfProperty(name = "data-api.auth.header-based.enabled", stringValue = "true") HttpAuthenticationMechanism httpAuthenticationMechanism( AuthConfig config, Instance customChallengeSender) { String headerName = config.headerBased().headerName(); @@ -43,7 +43,7 @@ HttpAuthenticationMechanism httpAuthenticationMechanism( @Produces @ApplicationScoped - @LookupIfProperty(name = "stargate.auth.header-based.enabled", stringValue = "true") + @LookupIfProperty(name = "data-api.auth.header-based.enabled", stringValue = "true") IdentityProvider identityProvider() { return new HeaderIdentityProvider(); } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/JsonApiMetricsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/JsonApiMetricsConfig.java index fb77e99834..61e03623cc 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/JsonApiMetricsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/JsonApiMetricsConfig.java @@ -4,7 +4,7 @@ import io.smallrye.config.WithDefault; import jakarta.validation.constraints.NotBlank; -@ConfigMapping(prefix = "stargate.jsonapi.metric") +@ConfigMapping(prefix = "data-api.metric") public interface JsonApiMetricsConfig { @NotBlank @WithDefault("error.class") diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/MetricsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/MetricsConfig.java index c6cfb900ad..224c906c4d 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/MetricsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/v1/metrics/MetricsConfig.java @@ -8,7 +8,7 @@ import java.util.Map; /** Extra, Stargate related configuration for the metrics. */ -@ConfigMapping(prefix = "stargate.metrics") +@ConfigMapping(prefix = "data-api.metrics") public interface MetricsConfig { /** @@ -28,7 +28,7 @@ interface TenantRequestCounterConfig { /** * @return If tenant request counter is enabled. */ - @WithDefault("${stargate.multi-tenancy.enabled}") + @WithDefault("${data-api.multi-tenancy.enabled}") boolean enabled(); /** diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/AuthConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/AuthConfig.java index 4c949d3496..d188956543 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/AuthConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/AuthConfig.java @@ -25,7 +25,7 @@ import java.util.Optional; /** Authentication configuration. */ -@ConfigMapping(prefix = "stargate.auth") +@ConfigMapping(prefix = "data-api.auth") public interface AuthConfig { /** @@ -54,7 +54,7 @@ interface HeaderBasedAuthConfig { /** * @return If the customization of the challenge sending should be done. */ - @WithDefault("${stargate.exception-mappers.enabled:true}") + @WithDefault("${data-api.exception-mappers.enabled:true}") boolean customChallengeEnabled(); } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/CommandLevelLoggingConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/CommandLevelLoggingConfig.java index 9657739ad4..13237ff26b 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/CommandLevelLoggingConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/CommandLevelLoggingConfig.java @@ -24,7 +24,7 @@ import java.util.Set; /** Extra, JSON API command level logging related configurations. */ -@ConfigMapping(prefix = "stargate.jsonapi.logging") +@ConfigMapping(prefix = "data-api.logging") public interface CommandLevelLoggingConfig { /** diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/DatabaseLimitsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/DatabaseLimitsConfig.java index 49f5d66aa1..b460f897ff 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/DatabaseLimitsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/DatabaseLimitsConfig.java @@ -24,7 +24,7 @@ /** Configuration for limits that apply to Databases. */ @StaticInitSafe -@ConfigMapping(prefix = "stargate.database.limits") +@ConfigMapping(prefix = "data-api.database.limits") public interface DatabaseLimitsConfig { /** * Default setting for {@link #maxCollections()}}: maximum number of Collections allowed to be diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/DebugModeConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/DebugModeConfig.java index b3c8f50dd9..84dafb52aa 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/DebugModeConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/DebugModeConfig.java @@ -3,7 +3,7 @@ import io.smallrye.config.ConfigMapping; import io.smallrye.config.WithDefault; -@ConfigMapping(prefix = "stargate.debug") +@ConfigMapping(prefix = "data-api.debug") public interface DebugModeConfig { @WithDefault("false") diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java index 2f2a92b89a..918eac112f 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java @@ -10,7 +10,7 @@ * providers so has to be declared as {@link StaticInitSafe}. */ @StaticInitSafe -@ConfigMapping(prefix = "stargate.jsonapi.document.limits") +@ConfigMapping(prefix = "data-api.document.limits") public interface DocumentLimitsConfig { /** Defines the default maximum document size. */ int DEFAULT_MAX_DOCUMENT_SIZE = 4_000_000; diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/MultiTenancyConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/MultiTenancyConfig.java index 4d1998f9bb..779fec2b9a 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/MultiTenancyConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/MultiTenancyConfig.java @@ -24,7 +24,7 @@ import java.util.OptionalInt; /** Configuration mapping for the tenant resolver. */ -@ConfigMapping(prefix = "stargate.multi-tenancy") +@ConfigMapping(prefix = "data-api.multi-tenancy") public interface MultiTenancyConfig { /** diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java index 65b88e6d5d..576565ce66 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java @@ -30,7 +30,7 @@ import javax.annotation.Nullable; /** Configuration for the operation execution. */ -@ConfigMapping(prefix = "stargate.jsonapi.operations") +@ConfigMapping(prefix = "data-api.operations") public interface OperationsConfig { /** Defines the default max size of filter fields. */ int DEFAULT_MAX_FILTER_SIZE = 64; diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/constants/HttpConstants.java b/src/main/java/io/stargate/sgv2/jsonapi/config/constants/HttpConstants.java index 7928087311..2ae0e91809 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/constants/HttpConstants.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/constants/HttpConstants.java @@ -3,7 +3,7 @@ import io.smallrye.config.ConfigMapping; import io.smallrye.config.WithDefault; -@ConfigMapping(prefix = "stargate.jsonapi.http") +@ConfigMapping(prefix = "data-api.http") public interface HttpConstants { /** Data API Authentication token header name. */ diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/feature/FeaturesConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/feature/FeaturesConfig.java index 5e3cd55465..a0369c9078 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/feature/FeaturesConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/feature/FeaturesConfig.java @@ -8,11 +8,11 @@ * (with possible property / sysenv overrides). * *

NOTE: actual keys in YAML or similar configuration file would be {@code - * stargate.feature.}, where {@code } comes from {@link + * data-api.feature.}, where {@code } comes from {@link * ApiFeature#featureName()} (which is always lower-case). So, for example, to enable {@link - * ApiFeature#TABLES} feature, one would use: {@code stargate.feature.flags.tables} as the key. + * ApiFeature#TABLES} feature, one would use: {@code data-api.feature.flags.tables} as the key. */ -@ConfigMapping(prefix = "stargate.feature") +@ConfigMapping(prefix = "data-api.feature") public interface FeaturesConfig { // Quarkus/SmallRye Config won't accept use of `null` values, so we must bind // as Strings and only convert to Boolean when needed. diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/DefaultEmbeddingProviderConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/DefaultEmbeddingProviderConfig.java index 7032e02133..4b51e1de26 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/DefaultEmbeddingProviderConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/DefaultEmbeddingProviderConfig.java @@ -8,7 +8,7 @@ * Do NOT inject this interface, use EmbeddingProvidersConfig instead EmbeddingProvidersConfig bean * produced by EmbeddingProvidersConfigProducer based on EGW enabled or not */ -@ConfigMapping(prefix = "stargate.jsonapi.embedding") +@ConfigMapping(prefix = "data-api.embedding") public interface DefaultEmbeddingProviderConfig { // TODO: WHAT DOES THIS ACTUALLY RETURN ? diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java index cde7ad3819..db9278de38 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/embedding/configuration/EmbeddingProvidersConfig.java @@ -294,7 +294,7 @@ public String getApiName() { } } - @ConfigMapping(prefix = "stargate.jsonapi.custom.embedding") + @ConfigMapping(prefix = "data-api.custom.embedding") interface CustomConfig { @WithDefault("false") boolean enabled(); diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/collections/CreateCollectionOperation.java b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/collections/CreateCollectionOperation.java index 570fe4138c..552202a47e 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/collections/CreateCollectionOperation.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/collections/CreateCollectionOperation.java @@ -270,7 +270,7 @@ private Uni> executeCollectionCreation( collectionExisted); Multi indexResultMulti; /* - CI will override ddlDelayMillis to 0 using `-Dstargate.jsonapi.operations.database-config.ddl-delay-millis=0` + CI will override ddlDelayMillis to 0 using `-Ddata-api.operations.database-config.ddl-delay-millis=0` to speed up the test execution This is ok because CI is run as single cassandra instance and there is no need to wait for the schema changes to propagate */ diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/reranking/configuration/DefaultRerankingProviderConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/service/reranking/configuration/DefaultRerankingProviderConfig.java index 40bbaabed5..c7d10c143d 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/reranking/configuration/DefaultRerankingProviderConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/reranking/configuration/DefaultRerankingProviderConfig.java @@ -4,7 +4,7 @@ import jakarta.annotation.Nullable; import java.util.Map; -@ConfigMapping(prefix = "stargate.jsonapi.reranking") +@ConfigMapping(prefix = "data-api.reranking") public interface DefaultRerankingProviderConfig { @Nullable Map providers(); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 40a1095df8..c8ae37e180 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,7 +1,7 @@ --- # please keep properties in the alphabetical order -stargate: +data-api: # security and authentication configuration # see io.stargate.sgv2.jsonapi.config.AuthConfig for all config properties and options auth: diff --git a/src/main/resources/embedding-providers-config.yaml b/src/main/resources/embedding-providers-config.yaml index 06da3fea6d..fb93b5d282 100644 --- a/src/main/resources/embedding-providers-config.yaml +++ b/src/main/resources/embedding-providers-config.yaml @@ -1,469 +1,468 @@ # custom properties for enabling vectorize method -stargate: - jsonapi: - embedding: - providers: - openai: - #see https://platform.openai.com/docs/api-reference/embeddings/create - display-name: OpenAI - enabled: true - url: https://api.openai.com/v1/ - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: organizationId - type: string - required: false - help: "Organization ID will be passed as an OpenAI organization" - display-name: "Organization ID" - hint: "Add an (optional) organization ID" - - name: projectId - type: string - required: false - help: "Project ID will be passed as an OpenAI project header" - display-name: "Project ID" - hint: "Add an (optional) project ID" - properties: - max-batch-size: 2048 - models: - - name: text-embedding-3-small - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1536 - validation: - numeric-range: [2, 1536] - help: "Vector dimension to use in the database and when calling OpenAI." - - name: text-embedding-3-large - parameters: - - name: vectorDimension - type: number - required: true - default-value: 3072 - validation: - numeric-range: [256, 3072] - help: "Vector dimension to use in the database and when calling OpenAI." - - name: text-embedding-ada-002 - vector-dimension: 1536 - azureOpenAI: - # see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference - # see https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models - display-name: Azure OpenAI - enabled: true - url: https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}/embeddings?api-version=2024-02-01 - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: api-key - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: api-key - parameters: - - name: "resourceName" - type: string - required: true - help: "Azure OpenAI Service name" - display-name: "Resource name" - - name: "deploymentId" - type: string - required: true - help: "Deployment name" - display-name: "Deployment ID" - properties: - max-input-length: 16 - max-batch-size: 2048 - models: - - name: text-embedding-3-small - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1536 - validation: - numeric-range: [2, 1536] - help: "Vector dimension to use in the database and when calling Azure OpenAI." - - name: text-embedding-3-large - parameters: - - name: vectorDimension - type: number - required: true - # https://github.com/stargate/data-api/issues/1241: Docs claim 3072 is max, - # but using values above 1536 does not seem to work. So at least default - # to what seems like a legal value (but leave max higher in case issue is fixed). - default-value: 1536 - validation: - numeric-range: [256, 3072] - help: "Vector dimension to use in the database and when calling Azure OpenAI." - - name: text-embedding-ada-002 - vector-dimension: 1536 - bedrock: - display-name: Amazon Bedrock - enabled: true - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-access-id - forwarded: aws_access_key_id - - accepted: x-embedding-secret-id - forwarded: aws_secret_access_key - SHARED_SECRET: - enabled: false - tokens: - - accepted: accessId - forwarded: aws_access_key_id - - accepted: secretKey - forwarded: aws_secret_access_key - parameters: - - name: "region" - type: string - required: true - help: "AWS region where the model is hosted." - properties: - max-batch-size: 1 - models: - - name: amazon.titan-embed-text-v1 - vector-dimension: 1536 - - name: amazon.titan-embed-text-v2:0 - parameters: - - name: vectorDimension - type: number - required: false - default-value: 1024 - validation: - options: [256, 512, 1024] - help: "Vector dimension to use in the database and when calling Amazon Bedrock Titan V2 embedding model." - huggingface: - # see https://huggingface.co/blog/getting-started-with-embeddings - display-name: Hugging Face - Serverless - enabled: true - url: https://router.huggingface.co/hf-inference/models/{modelId}/pipeline/feature-extraction - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: sentence-transformers/all-MiniLM-L6-v2 - vector-dimension: 384 - - name: intfloat/multilingual-e5-large - vector-dimension: 1024 - - name: intfloat/multilingual-e5-large-instruct - vector-dimension: 1024 - - name: BAAI/bge-small-en-v1.5 - vector-dimension: 384 - - name: BAAI/bge-base-en-v1.5 - vector-dimension: 768 - - name: BAAI/bge-large-en-v1.5 - vector-dimension: 1024 - huggingfaceDedicated: - # see https://huggingface.co/docs/inference-endpoints/en/supported_tasks#sentence-embeddings - display-name: Hugging Face - Dedicated - enabled: true - url: https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: endpoint-defined-model - parameters: - - name: vectorDimension - type: number - required: true - validation: - numeric-range: [2, 3072] - help: "Vector dimension to use in the database, should be the same as the model used by the endpoint." - parameters: - - name: "endpointName" - type: string - required: true - help: "Add the first part of the dedicated endpoint URL" - display-name: "Endpoint name" - hint: "Add endpoint name" - - name: "regionName" - type: string - required: true - help: "Add the second part of the dedicated endpoint URL" - display-name: "Region name" - hint: "Add region name" - - name: "cloudName" - type: string - required: true - help: "Add the third part of the dedicated endpoint URL" - display-name: "Cloud provider where the dedicated endpoint is deployed" - hint: "Add cloud name" - # OUT OF SCOPE FOR INITIAL PREVIEW - vertexai: - # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text - display-name: Google Vertex AI - enabled: false - url: "https://us-central1-aiplatform.googleapis.com/v1/projects/{projectId}/locations/us-central1/publishers/google/models" - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: projectId - type: string - required: true - help: "The Google Cloud Project ID to use when calling" - properties: - task-type-store: RETRIEVAL_DOCUMENT # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#api_changes_to_models_released_on_or_after_august_2023 - task-type-read: QUESTION_ANSWERING - max-input-length: 5 - max-batch-size: 32 - models: - - name: textembedding-gecko@003 - vector-dimension: 768 - parameters: - - name: "autoTruncate" - type: boolean - required: false - default-value: true - help: "If set to false, text that exceeds the token limit causes the request to fail. The default value is true." - # COHERE was OUT OF SCOPE FOR INITIAL PREVIEW, TODO: decide if we want to enable, drop if not. - cohere: - # see https://docs.cohere.com/reference/embed - display-name: Cohere - enabled: false - url: https://api.cohere.ai/v1/ - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: embed-english-v3.0 - vector-dimension: 1024 - - name: embed-english-v2.0 - vector-dimension: 4096 - nvidia: - # see https://docs.api.nvidia.com/nim/reference/nvidia-embedding-2b-infer - display-name: Nvidia - enabled: true - url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/embeddings/nv-embed-qa-v4 - auth-token-pass-through-for-none-auth: true - supported-authentications: - NONE: - enabled: true - properties: - max-batch-size: 8 - models: - - name: NV-Embed-QA - vector-dimension: 1024 - properties: - max-tokens: 512 - jinaAI: - #see https://jina.ai/embeddings/#apiform - display-name: Jina AI - enabled: true - url: https://api.jina.ai/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: +data-api: + embedding: + providers: + openai: + #see https://platform.openai.com/docs/api-reference/embeddings/create + display-name: OpenAI + enabled: true + url: https://api.openai.com/v1/ + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: organizationId + type: string + required: false + help: "Organization ID will be passed as an OpenAI organization" + display-name: "Organization ID" + hint: "Add an (optional) organization ID" + - name: projectId + type: string + required: false + help: "Project ID will be passed as an OpenAI project header" + display-name: "Project ID" + hint: "Add an (optional) project ID" + properties: + max-batch-size: 2048 + models: + - name: text-embedding-3-small + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1536 + validation: + numeric-range: [2, 1536] + help: "Vector dimension to use in the database and when calling OpenAI." + - name: text-embedding-3-large + parameters: + - name: vectorDimension + type: number + required: true + default-value: 3072 + validation: + numeric-range: [256, 3072] + help: "Vector dimension to use in the database and when calling OpenAI." + - name: text-embedding-ada-002 + vector-dimension: 1536 + azureOpenAI: + # see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference + # see https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models + display-name: Azure OpenAI + enabled: true + url: https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}/embeddings?api-version=2024-02-01 + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: api-key + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: api-key + parameters: + - name: "resourceName" + type: string + required: true + help: "Azure OpenAI Service name" + display-name: "Resource name" + - name: "deploymentId" + type: string + required: true + help: "Deployment name" + display-name: "Deployment ID" + properties: + max-input-length: 16 + max-batch-size: 2048 + models: + - name: text-embedding-3-small + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1536 + validation: + numeric-range: [2, 1536] + help: "Vector dimension to use in the database and when calling Azure OpenAI." + - name: text-embedding-3-large + parameters: + - name: vectorDimension + type: number + required: true + # https://github.com/stargate/data-api/issues/1241: Docs claim 3072 is max, + # but using values above 1536 does not seem to work. So at least default + # to what seems like a legal value (but leave max higher in case issue is fixed). + default-value: 1536 + validation: + numeric-range: [256, 3072] + help: "Vector dimension to use in the database and when calling Azure OpenAI." + - name: text-embedding-ada-002 + vector-dimension: 1536 + bedrock: + display-name: Amazon Bedrock + enabled: true + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-access-id + forwarded: aws_access_key_id + - accepted: x-embedding-secret-id + forwarded: aws_secret_access_key + SHARED_SECRET: + enabled: false + tokens: + - accepted: accessId + forwarded: aws_access_key_id + - accepted: secretKey + forwarded: aws_secret_access_key + parameters: + - name: "region" + type: string + required: true + help: "AWS region where the model is hosted." + properties: + max-batch-size: 1 + models: + - name: amazon.titan-embed-text-v1 + vector-dimension: 1536 + - name: amazon.titan-embed-text-v2:0 + parameters: + - name: vectorDimension + type: number + required: false + default-value: 1024 + validation: + options: [256, 512, 1024] + help: "Vector dimension to use in the database and when calling Amazon Bedrock Titan V2 embedding model." + huggingface: + # see https://huggingface.co/blog/getting-started-with-embeddings + display-name: Hugging Face - Serverless + enabled: true + url: https://router.huggingface.co/hf-inference/models/{modelId}/pipeline/feature-extraction + supported-authentications: + NONE: + enabled: false + HEADER: enabled: true tokens: - accepted: x-embedding-api-key forwarded: Authorization - SHARED_SECRET: + SHARED_SECRET: enabled: false tokens: - accepted: providerKey forwarded: Authorization - properties: - initial-back-off-millis: 1000 - max-back-off-millis: 1000 - max-batch-size: 32 - models: - - name: jina-embeddings-v2-base-en - vector-dimension: 768 - - name: jina-embeddings-v2-base-de - vector-dimension: 768 - - name: jina-embeddings-v2-base-es - vector-dimension: 768 - - name: jina-embeddings-v2-base-code - vector-dimension: 768 - - name: jina-embeddings-v2-base-zh - vector-dimension: 768 - - name: jina-embeddings-v3 - # https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/ - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1024 - validation: - numeric-range: [1, 1024] - help: "Vector dimension to use in the database and when calling Jina AI." - - name: task - type: string - required: false - default-value: text-matching - help: "Select the downstream task for which the embeddings will be used. The model will return the optimized embeddings for that task. Available options are: retrieval.passage, retrieval.query, separation, classification, text-matching. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." - - name: late_chunking - type: boolean - required: false - default-value: false - help: "Apply the late chunking technique to leverage the model's long-context capabilities for generating contextual chunk embeddings. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." - voyageAI: - # see https://docs.voyageai.com/reference/embeddings-api - # see https://docs.voyageai.com/docs/embeddings - display-name: Voyage AI - enabled: true - url: https://api.voyageai.com/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: "autoTruncate" - type: BOOLEAN - required: false - default-value: true - help: "Whether to truncate the input texts to fit within the context length. Defaults to true." - properties: - max-input-length: 128 - task-type-store: document - task-type-read: query - max-batch-size: 32 - models: - - name: voyage-large-2-instruct - vector-dimension: 1024 - - name: voyage-law-2 - vector-dimension: 1024 - - name: voyage-code-2 - vector-dimension: 1536 - - name: voyage-large-2 - vector-dimension: 1536 - - name: voyage-2 - vector-dimension: 1024 - - name: voyage-finance-2 - vector-dimension: 1024 - - name: voyage-multilingual-2 - vector-dimension: 1024 - mistral: - # see https://docs.mistral.ai/api/#operation/createEmbedding - display-name: Mistral AI - enabled: true - url: https://api.mistral.ai/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - properties: - max-batch-size: 32 - models: - - name: mistral-embed - vector-dimension: 1024 + properties: + max-batch-size: 32 + models: + - name: sentence-transformers/all-MiniLM-L6-v2 + vector-dimension: 384 + - name: intfloat/multilingual-e5-large + vector-dimension: 1024 + - name: intfloat/multilingual-e5-large-instruct + vector-dimension: 1024 + - name: BAAI/bge-small-en-v1.5 + vector-dimension: 384 + - name: BAAI/bge-base-en-v1.5 + vector-dimension: 768 + - name: BAAI/bge-large-en-v1.5 + vector-dimension: 1024 + huggingfaceDedicated: + # see https://huggingface.co/docs/inference-endpoints/en/supported_tasks#sentence-embeddings + display-name: Hugging Face - Dedicated + enabled: true + url: https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + max-batch-size: 32 + models: + - name: endpoint-defined-model + parameters: + - name: vectorDimension + type: number + required: true + validation: + numeric-range: [2, 3072] + help: "Vector dimension to use in the database, should be the same as the model used by the endpoint." + parameters: + - name: "endpointName" + type: string + required: true + help: "Add the first part of the dedicated endpoint URL" + display-name: "Endpoint name" + hint: "Add endpoint name" + - name: "regionName" + type: string + required: true + help: "Add the second part of the dedicated endpoint URL" + display-name: "Region name" + hint: "Add region name" + - name: "cloudName" + type: string + required: true + help: "Add the third part of the dedicated endpoint URL" + display-name: "Cloud provider where the dedicated endpoint is deployed" + hint: "Add cloud name" + # OUT OF SCOPE FOR INITIAL PREVIEW + vertexai: + # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text + display-name: Google Vertex AI + enabled: false + url: "https://us-central1-aiplatform.googleapis.com/v1/projects/{projectId}/locations/us-central1/publishers/google/models" + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: projectId + type: string + required: true + help: "The Google Cloud Project ID to use when calling" + properties: + task-type-store: RETRIEVAL_DOCUMENT # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#api_changes_to_models_released_on_or_after_august_2023 + task-type-read: QUESTION_ANSWERING + max-input-length: 5 + max-batch-size: 32 + models: + - name: textembedding-gecko@003 + vector-dimension: 768 + parameters: + - name: "autoTruncate" + type: boolean + required: false + default-value: true + help: "If set to false, text that exceeds the token limit causes the request to fail. The default value is true." + # COHERE was OUT OF SCOPE FOR INITIAL PREVIEW, TODO: decide if we want to enable, drop if not. + cohere: + # see https://docs.cohere.com/reference/embed + display-name: Cohere + enabled: false + url: https://api.cohere.ai/v1/ + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + max-batch-size: 32 + models: + - name: embed-english-v3.0 + vector-dimension: 1024 + - name: embed-english-v2.0 + vector-dimension: 4096 + nvidia: + # see https://docs.api.nvidia.com/nim/reference/nvidia-embedding-2b-infer + display-name: Nvidia + enabled: true + url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/embeddings/nv-embed-qa-v4 + auth-token-pass-through-for-none-auth: true + supported-authentications: + NONE: + enabled: true + properties: + max-batch-size: 8 + models: + - name: NV-Embed-QA + vector-dimension: 1024 + properties: + max-tokens: 512 + jinaAI: + #see https://jina.ai/embeddings/#apiform + display-name: Jina AI + enabled: true + url: https://api.jina.ai/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + initial-back-off-millis: 1000 + max-back-off-millis: 1000 + max-batch-size: 32 + models: + - name: jina-embeddings-v2-base-en + vector-dimension: 768 + - name: jina-embeddings-v2-base-de + vector-dimension: 768 + - name: jina-embeddings-v2-base-es + vector-dimension: 768 + - name: jina-embeddings-v2-base-code + vector-dimension: 768 + - name: jina-embeddings-v2-base-zh + vector-dimension: 768 + - name: jina-embeddings-v3 + # https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/ + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1024 + validation: + numeric-range: [1, 1024] + help: "Vector dimension to use in the database and when calling Jina AI." + - name: task + type: string + required: false + default-value: text-matching + help: "Select the downstream task for which the embeddings will be used. The model will return the optimized embeddings for that task. Available options are: retrieval.passage, retrieval.query, separation, classification, text-matching. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." + - name: late_chunking + type: boolean + required: false + default-value: false + help: "Apply the late chunking technique to leverage the model's long-context capabilities for generating contextual chunk embeddings. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." + voyageAI: + # see https://docs.voyageai.com/reference/embeddings-api + # see https://docs.voyageai.com/docs/embeddings + display-name: Voyage AI + enabled: true + url: https://api.voyageai.com/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: "autoTruncate" + type: BOOLEAN + required: false + default-value: true + help: "Whether to truncate the input texts to fit within the context length. Defaults to true." + properties: + max-input-length: 128 + task-type-store: document + task-type-read: query + max-batch-size: 32 + models: + - name: voyage-large-2-instruct + vector-dimension: 1024 + - name: voyage-law-2 + vector-dimension: 1024 + - name: voyage-code-2 + vector-dimension: 1536 + - name: voyage-large-2 + vector-dimension: 1536 + - name: voyage-2 + vector-dimension: 1024 + - name: voyage-finance-2 + vector-dimension: 1024 + - name: voyage-multilingual-2 + vector-dimension: 1024 + mistral: + # see https://docs.mistral.ai/api/#operation/createEmbedding + display-name: Mistral AI + enabled: true + url: https://api.mistral.ai/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + properties: + max-batch-size: 32 + models: + - name: mistral-embed + vector-dimension: 1024 - # NOTE: UpstageAI has one model for storing and a diff one for reading: this is different - # from everyone else. For now handling this requires explicit handling by actual - # embedding client implementation: model name here is a prefix for the actual model name. - # In addition, implementation only supports 1-entry vectorization. - upstageAI: - # see https://developers.upstage.ai/docs/apis/embeddings - display-name: Upstage - enabled: true - url: https://api.upstage.ai/v1/solar/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - properties: - max-batch-size: 1 - models: - # NOTE: this is where weirdness exists; model name is prefix on which - # either "-query" or "-passage" is appended to get the actual model name - - name: solar-embedding-1-large - vector-dimension: 4096 + # NOTE: UpstageAI has one model for storing and a diff one for reading: this is different + # from everyone else. For now handling this requires explicit handling by actual + # embedding client implementation: model name here is a prefix for the actual model name. + # In addition, implementation only supports 1-entry vectorization. + upstageAI: + # see https://developers.upstage.ai/docs/apis/embeddings + display-name: Upstage + enabled: true + url: https://api.upstage.ai/v1/solar/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + properties: + max-batch-size: 1 + models: + # NOTE: this is where weirdness exists; model name is prefix on which + # either "-query" or "-passage" is appended to get the actual model name + - name: solar-embedding-1-large + vector-dimension: 4096 diff --git a/src/main/resources/reranking-providers-config.yaml b/src/main/resources/reranking-providers-config.yaml index 67739fe0a2..113250a464 100644 --- a/src/main/resources/reranking-providers-config.yaml +++ b/src/main/resources/reranking-providers-config.yaml @@ -1,17 +1,16 @@ -stargate: - jsonapi: - reranking: - providers: - nvidia: - is-default: true - display-name: Nvidia - enabled: true - supported-authentications: - NONE: - enabled: true - models: - - name: nvidia/llama-3.2-nv-rerankqa-1b-v2 - is-default: true - url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking - properties: - max-batch-size: 10 \ No newline at end of file +data-api: + reranking: + providers: + nvidia: + is-default: true + display-name: Nvidia + enabled: true + supported-authentications: + NONE: + enabled: true + models: + - name: nvidia/llama-3.2-nv-rerankqa-1b-v2 + is-default: true + url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking + properties: + max-batch-size: 10 \ No newline at end of file diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/model/command/impl/InsertManyCommandTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/model/command/impl/InsertManyCommandTest.java index 2fdcef891a..e42a4d4ecd 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/model/command/impl/InsertManyCommandTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/model/command/impl/InsertManyCommandTest.java @@ -22,7 +22,7 @@ public static class Profile implements NoGlobalResourcesTestProfile { @Override public Map getConfigOverrides() { - return Map.of("stargate.jsonapi.operations.max-document-insert-count", "2"); + return Map.of("data-api.operations.max-document-insert-count", "2"); } } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/EmbeddingClientTestResource.java b/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/EmbeddingClientTestResource.java index 25465f62fb..77bafd624c 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/EmbeddingClientTestResource.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/EmbeddingClientTestResource.java @@ -18,9 +18,9 @@ public class EmbeddingClientTestResource implements QuarkusTestResourceLifecycle // NOTE: These are the host and path to use with this lifecycle manager. // previously the start() methods returned below to override quarkus config properties, // return Map.of( - // "stargate.jsonapi.embedding.providers.nvidia.url", + // "data-api.embedding.providers.nvidia.url", // wireMockServer.baseUrl() + "/v1/embeddings", - // "stargate.jsonapi.embedding.providers.openai.url", + // "data-api.embedding.providers.openai.url", // wireMockServer.baseUrl() + "/v1/"); public static final String HOST = "http://localhost:8080"; diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/PropertyBasedOverrideProfile.java b/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/PropertyBasedOverrideProfile.java index f31d49c042..8b88865131 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/PropertyBasedOverrideProfile.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/embedding/operation/PropertyBasedOverrideProfile.java @@ -13,13 +13,11 @@ public boolean disableGlobalTestResources() { @Override public Map getConfigOverrides() { return ImmutableMap.builder() - .put("stargate.jsonapi.embedding.providers.openai.enabled", "true") - .put("stargate.jsonapi.embedding.providers.openai.url", "https://api.openai.com/v1/") - .put("stargate.jsonapi.embedding.providers.huggingface.enabled", "true") - .put( - "stargate.jsonapi.embedding.providers.huggingface.url", - "https://api-inference.huggingface.co") - .put("stargate.jsonapi.embedding.providers.vertexai.enabled", "false") + .put("data-api.embedding.providers.openai.enabled", "true") + .put("data-api.embedding.providers.openai.url", "https://api.openai.com/v1/") + .put("data-api.embedding.providers.huggingface.enabled", "true") + .put("data-api.embedding.providers.huggingface.url", "https://api-inference.huggingface.co") + .put("data-api.embedding.providers.vertexai.enabled", "false") .build(); } } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/collections/SerialConsistencyOverrideOperationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/collections/SerialConsistencyOverrideOperationTest.java index 4124809482..1ebb2fbdbe 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/collections/SerialConsistencyOverrideOperationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/collections/SerialConsistencyOverrideOperationTest.java @@ -84,7 +84,7 @@ public boolean disableGlobalTestResources() { @Override public Map getConfigOverrides() { return ImmutableMap.builder() - .put("stargate.queries.serial-consistency", "LOCAL_SERIAL") + .put("data-api.queries.serial-consistency", "LOCAL_SERIAL") .build(); } } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/DisableVectorizeProfile.java b/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/DisableVectorizeProfile.java index ddf69aaf18..eaff91d474 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/DisableVectorizeProfile.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/DisableVectorizeProfile.java @@ -13,7 +13,7 @@ public boolean disableGlobalTestResources() { @Override public Map getConfigOverrides() { return ImmutableMap.builder() - .put("stargate.jsonapi.operations.vectorize-enabled", "false") + .put("data-api.operations.vectorize-enabled", "false") .build(); } } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/EnabledVectorizeProfile.java b/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/EnabledVectorizeProfile.java index 64fe0da76a..692aa10c3c 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/EnabledVectorizeProfile.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/resolver/EnabledVectorizeProfile.java @@ -13,7 +13,7 @@ public boolean disableGlobalTestResources() { @Override public Map getConfigOverrides() { return ImmutableMap.builder() - .put("stargate.jsonapi.operations.vectorize-enabled", "true") + .put("data-api.operations.vectorize-enabled", "true") .build(); } } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java b/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java index 8503503a82..0a980b68c2 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java @@ -131,68 +131,67 @@ public Map start() { propsBuilder.put("RERANKING_CONFIG_RESOURCE", "test-reranking-providers-config.yaml"); propsBuilder.put("EMBEDDING_CONFIG_RESOURCE", "test-embedding-providers-config.yaml"); - propsBuilder.put("stargate.jsonapi.custom.embedding.enabled", "true"); + propsBuilder.put("data-api.custom.embedding.enabled", "true"); // 17-Mar-2025, tatu: [data-api#1903] Lexical search/sort feature flag String lexicalFeatureSetting = getFeatureFlagLexical(); if (lexicalFeatureSetting != null) { - propsBuilder.put("stargate.feature.flags.lexical", lexicalFeatureSetting); + propsBuilder.put("data-api.feature.flags.lexical", lexicalFeatureSetting); } // 04-Sep-2024, tatu: [data-api#1335] Enable Tables using new Feature Flag: String tableFeatureSetting = getFeatureFlagTables(); if (tableFeatureSetting != null) { - propsBuilder.put("stargate.feature.flags.tables", tableFeatureSetting); + propsBuilder.put("data-api.feature.flags.tables", tableFeatureSetting); } // 31-Mar-2025, yuqi: [data-api#1904] Reranking feature flag: String featureFlagReranking = getFeatureFlagReranking(); if (featureFlagReranking != null) { - propsBuilder.put("stargate.feature.flags.reranking", featureFlagReranking); + propsBuilder.put("data-api.feature.flags.reranking", featureFlagReranking); } propsBuilder.put( - "stargate.jsonapi.custom.embedding.clazz", + "data-api.custom.embedding.clazz", "io.stargate.sgv2.jsonapi.service.embedding.operation.test.CustomITEmbeddingProvider"); propsBuilder.put( - "stargate.jsonapi.embedding.providers.huggingface.supported-authentications.HEADER.enabled", + "data-api.embedding.providers.huggingface.supported-authentications.HEADER.enabled", "false"); propsBuilder.put( - "stargate.jsonapi.embedding.providers.openai.supported-authentications.SHARED_SECRET.enabled", + "data-api.embedding.providers.openai.supported-authentications.SHARED_SECRET.enabled", "true"); - propsBuilder.put("stargate.jsonapi.embedding.providers.vertexai.enabled", "true"); + propsBuilder.put("data-api.embedding.providers.vertexai.enabled", "true"); propsBuilder.put( - "stargate.jsonapi.embedding.providers.vertexai.models[0].parameters[0].required", "true"); + "data-api.embedding.providers.vertexai.models[0].parameters[0].required", "true"); if (this.containerNetworkId.isPresent()) { String host = useCoordinator() ? System.getProperty("quarkus.grpc.clients.bridge.host") : System.getProperty("stargate.int-test.cassandra.host"); - propsBuilder.put("stargate.jsonapi.operations.database-config.cassandra-end-points", host); + propsBuilder.put("data-api.operations.database-config.cassandra-end-points", host); } else { int port = useCoordinator() ? Integer.getInteger(IntegrationTestUtils.STARGATE_CQL_PORT_PROP) : Integer.getInteger(IntegrationTestUtils.CASSANDRA_CQL_PORT_PROP); - propsBuilder.put( - "stargate.jsonapi.operations.database-config.cassandra-port", String.valueOf(port)); + propsBuilder.put("data-api.operations.database-config.cassandra-port", String.valueOf(port)); } if (useCoordinator()) { String defaultToken = System.getProperty(IntegrationTestUtils.AUTH_TOKEN_PROP); if (defaultToken != null) { - propsBuilder.put("stargate.jsonapi.operations.database-config.fixed-token", defaultToken); + propsBuilder.put("data-api.operations.database-config.fixed-token", defaultToken); } } if (isDse() || isHcd()) { - propsBuilder.put("stargate.jsonapi.operations.database-config.local-datacenter", "dc1"); + propsBuilder.put("data-api.operations.database-config.local-datacenter", "dc1"); } propsBuilder.put("stargate.data-store.ignore-bridge", "true"); - propsBuilder.put("stargate.debug.enabled", "true"); + propsBuilder.put("data-api.debug.enabled", "true"); // Reduce the delay for ITs if (Boolean.getBoolean("run-create-index-parallel")) { - propsBuilder.put("stargate.jsonapi.operations.database-config.ddl-delay-millis", "0"); + propsBuilder.put("data-api.operations.database-config.ddl-delay-millis", "0"); } else { - propsBuilder.put("stargate.jsonapi.operations.database-config.ddl-delay-millis", "50"); + propsBuilder.put("data-api.operations.database-config.ddl-delay-millis", "50"); } return propsBuilder.build(); } diff --git a/src/test/java/io/stargate/sgv2/jsonapi/testresource/StargateTestResource.java b/src/test/java/io/stargate/sgv2/jsonapi/testresource/StargateTestResource.java index 5f1ee4b46c..16eb073713 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/testresource/StargateTestResource.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/testresource/StargateTestResource.java @@ -83,22 +83,19 @@ public Map start() { propsBuilder.put("stargate.int-test.cluster.persistence", getPersistenceModule()); // Many ITs create more Collections than default Max 5, use more than 50 indexes so: propsBuilder.put( - "stargate.database.limits.max-collections", + "data-api.database.limits.max-collections", String.valueOf(getMaxCollectionsPerDBOverride())); propsBuilder.put( - "stargate.database.limits.indexes-available-per-database", + "data-api.database.limits.indexes-available-per-database", String.valueOf(getIndexesPerDBOverride())); + propsBuilder.put("data-api.operations.max-count-limit", String.valueOf(getMaxCountLimit())); propsBuilder.put( - "stargate.jsonapi.operations.max-count-limit", String.valueOf(getMaxCountLimit())); - propsBuilder.put( - "stargate.jsonapi.operations.default-count-page-size", - String.valueOf(getCountPageSize())); + "data-api.operations.default-count-page-size", String.valueOf(getCountPageSize())); Long maxToSort = getMaxDocumentSortCount(); if (maxToSort != null) { - propsBuilder.put( - "stargate.jsonapi.operations.max-document-sort-count", String.valueOf(maxToSort)); + propsBuilder.put("data-api.operations.max-document-sort-count", String.valueOf(maxToSort)); } - propsBuilder.put("stargate.jsonapi.operations.vectorize-enabled", "true"); + propsBuilder.put("data-api.operations.vectorize-enabled", "true"); ImmutableMap props = propsBuilder.build(); props.forEach(System::setProperty); From cfacc553df797d997650e0f4421a85520fc0c708 Mon Sep 17 00:00:00 2001 From: Hazel Date: Mon, 29 Sep 2025 12:06:44 -0700 Subject: [PATCH 2/4] Fix application.yaml in tests --- docker-compose/README.md | 2 +- .../io/stargate/sgv2/jsonapi/testresource/DseTestResource.java | 2 +- src/test/resources/application.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose/README.md b/docker-compose/README.md index f50a52936e..e60ca39fb1 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -76,7 +76,7 @@ To run local non-Docker instance of Data API, use `-d` with the script: it will To run locally built Data API in Quarkus Development mode, you will use: ``` -/mvnw compile quarkus:dev -Dstargate.data-store.ignore-bridge=true \ +/mvnw compile quarkus:dev -Ddata-api.data-store.ignore-bridge=true \ -Ddata-api.operations.vectorize-enabled=true \ -Ddata-api.operations.database-config.local-datacenter=dc1 ``` diff --git a/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java b/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java index 0a980b68c2..9fa96bc163 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/testresource/DseTestResource.java @@ -185,7 +185,7 @@ public Map start() { if (isDse() || isHcd()) { propsBuilder.put("data-api.operations.database-config.local-datacenter", "dc1"); } - propsBuilder.put("stargate.data-store.ignore-bridge", "true"); + propsBuilder.put("data-api.data-store.ignore-bridge", "true"); propsBuilder.put("data-api.debug.enabled", "true"); // Reduce the delay for ITs if (Boolean.getBoolean("run-create-index-parallel")) { diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml index a1c5c8785a..332ac4b07b 100644 --- a/src/test/resources/application.yaml +++ b/src/test/resources/application.yaml @@ -1,4 +1,4 @@ -stargate: +data-api: debug: enabled: true feature: # See io.stargate.sgv2.jsonapi.config.feature.FeaturesConfig From 6071b0373ae2e495a72a3584d875ece98de9661a Mon Sep 17 00:00:00 2001 From: Hazel Date: Mon, 29 Sep 2025 12:23:14 -0700 Subject: [PATCH 3/4] Fix test providers config --- .../test-embedding-providers-config.yaml | 935 +++++++++--------- .../test-reranking-providers-config.yaml | 61 +- 2 files changed, 497 insertions(+), 499 deletions(-) diff --git a/src/main/resources/test-embedding-providers-config.yaml b/src/main/resources/test-embedding-providers-config.yaml index 6b32693bde..a23c181a06 100644 --- a/src/main/resources/test-embedding-providers-config.yaml +++ b/src/main/resources/test-embedding-providers-config.yaml @@ -1,479 +1,478 @@ # custom properties for enabling vectorize method -stargate: - jsonapi: - embedding: - providers: - openai: - #see https://platform.openai.com/docs/api-reference/embeddings/create - display-name: OpenAI - enabled: true - url: https://api.openai.com/v1/ - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: organizationId - type: string - required: false - help: "Organization ID will be passed as an OpenAI organization" - display-name: "Organization ID" - hint: "Add an (optional) organization ID" - - name: projectId - type: string - required: false - help: "Project ID will be passed as an OpenAI project header" - display-name: "Project ID" - hint: "Add an (optional) project ID" - properties: - max-batch-size: 2048 - models: - - name: text-embedding-3-small - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1536 - validation: - numeric-range: [2, 1536] - help: "Vector dimension to use in the database and when calling OpenAI." - - name: text-embedding-3-large - parameters: - - name: vectorDimension - type: number - required: true - default-value: 3072 - validation: - numeric-range: [256, 3072] - help: "Vector dimension to use in the database and when calling OpenAI." - - name: text-embedding-ada-002 - vector-dimension: 1536 - azureOpenAI: - # see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference - # see https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models - display-name: Azure OpenAI - enabled: true - url: https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}/embeddings?api-version=2024-02-01 - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: api-key - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: api-key - parameters: - - name: "resourceName" - type: string - required: true - help: "Azure OpenAI Service name" - display-name: "Resource name" - - name: "deploymentId" - type: string - required: true - help: "Deployment name" - display-name: "Deployment ID" - properties: - max-input-length: 16 - max-batch-size: 2048 - models: - - name: text-embedding-3-small - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1536 - validation: - numeric-range: [2, 1536] - help: "Vector dimension to use in the database and when calling Azure OpenAI." - - name: text-embedding-3-large - parameters: - - name: vectorDimension - type: number - required: true - # https://github.com/stargate/data-api/issues/1241: Docs claim 3072 is max, - # but using values above 1536 does not seem to work. So at least default - # to what seems like a legal value (but leave max higher in case issue is fixed). - default-value: 1536 - validation: - numeric-range: [256, 3072] - help: "Vector dimension to use in the database and when calling Azure OpenAI." - - name: text-embedding-ada-002 - vector-dimension: 1536 - bedrock: - display-name: Amazon Bedrock - enabled: true - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-access-id - forwarded: aws_access_key_id - - accepted: x-embedding-secret-id - forwarded: aws_secret_access_key - SHARED_SECRET: - enabled: false - tokens: - - accepted: accessId - forwarded: aws_access_key_id - - accepted: secretKey - forwarded: aws_secret_access_key - parameters: - - name: "region" - type: string - required: true - help: "AWS region where the model is hosted." - properties: - max-batch-size: 1 - models: - - name: amazon.titan-embed-text-v1 - vector-dimension: 1536 - - name: amazon.titan-embed-text-v2:0 - parameters: - - name: vectorDimension - type: number - required: false - default-value: 1024 - validation: - options: [256, 512, 1024] - help: "Vector dimension to use in the database and when calling Amazon Bedrock Titan V2 embedding model." - huggingface: - # see https://huggingface.co/blog/getting-started-with-embeddings - display-name: Hugging Face - Serverless - enabled: true - url: https://api-inference.huggingface.co/pipeline/feature-extraction/ - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: sentence-transformers/all-MiniLM-L6-v2 - vector-dimension: 384 - - name: intfloat/multilingual-e5-large - vector-dimension: 1024 - - name: intfloat/multilingual-e5-large-instruct - vector-dimension: 1024 - - name: BAAI/bge-small-en-v1.5 - vector-dimension: 384 - - name: BAAI/bge-base-en-v1.5 - vector-dimension: 768 - - name: BAAI/bge-large-en-v1.5 - vector-dimension: 1024 - huggingfaceDedicated: - # see https://huggingface.co/docs/inference-endpoints/en/supported_tasks#sentence-embeddings - display-name: Hugging Face - Dedicated - enabled: true - url: https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: endpoint-defined-model - parameters: - - name: vectorDimension - type: number - required: true - validation: - numeric-range: [2, 3072] - help: "Vector dimension to use in the database, should be the same as the model used by the endpoint." - parameters: - - name: "endpointName" - type: string - required: true - help: "Add the first part of the dedicated endpoint URL" - display-name: "Endpoint name" - hint: "Add endpoint name" - - name: "regionName" - type: string - required: true - help: "Add the second part of the dedicated endpoint URL" - display-name: "Region name" - hint: "Add region name" - - name: "cloudName" - type: string - required: true - help: "Add the third part of the dedicated endpoint URL" - display-name: "Cloud provider where the dedicated endpoint is deployed" - hint: "Add cloud name" - # OUT OF SCOPE FOR INITIAL PREVIEW - vertexai: - # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text - display-name: Google Vertex AI - enabled: false - url: "https://us-central1-aiplatform.googleapis.com/v1/projects/{projectId}/locations/us-central1/publishers/google/models" - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: projectId - type: string - required: true - help: "The Google Cloud Project ID to use when calling" - properties: - task-type-store: RETRIEVAL_DOCUMENT # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#api_changes_to_models_released_on_or_after_august_2023 - task-type-read: QUESTION_ANSWERING - max-input-length: 5 - max-batch-size: 32 - models: - - name: textembedding-gecko@003 - vector-dimension: 768 - parameters: - - name: "autoTruncate" - type: boolean - required: false - default-value: true - help: "If set to false, text that exceeds the token limit causes the request to fail. The default value is true." - # OUT OF SCOPE FOR INITIAL PREVIEW - cohere: - # see https://docs.cohere.com/reference/embed - display-name: Cohere - enabled: false - url: https://api.cohere.ai/v1/ - supported-authentications: - NONE: - enabled: false - HEADER: +data-api: + embedding: + providers: + openai: + #see https://platform.openai.com/docs/api-reference/embeddings/create + display-name: OpenAI + enabled: true + url: https://api.openai.com/v1/ + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: organizationId + type: string + required: false + help: "Organization ID will be passed as an OpenAI organization" + display-name: "Organization ID" + hint: "Add an (optional) organization ID" + - name: projectId + type: string + required: false + help: "Project ID will be passed as an OpenAI project header" + display-name: "Project ID" + hint: "Add an (optional) project ID" + properties: + max-batch-size: 2048 + models: + - name: text-embedding-3-small + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1536 + validation: + numeric-range: [2, 1536] + help: "Vector dimension to use in the database and when calling OpenAI." + - name: text-embedding-3-large + parameters: + - name: vectorDimension + type: number + required: true + default-value: 3072 + validation: + numeric-range: [256, 3072] + help: "Vector dimension to use in the database and when calling OpenAI." + - name: text-embedding-ada-002 + vector-dimension: 1536 + azureOpenAI: + # see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference + # see https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models + display-name: Azure OpenAI + enabled: true + url: https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}/embeddings?api-version=2024-02-01 + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: api-key + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: api-key + parameters: + - name: "resourceName" + type: string + required: true + help: "Azure OpenAI Service name" + display-name: "Resource name" + - name: "deploymentId" + type: string + required: true + help: "Deployment name" + display-name: "Deployment ID" + properties: + max-input-length: 16 + max-batch-size: 2048 + models: + - name: text-embedding-3-small + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1536 + validation: + numeric-range: [2, 1536] + help: "Vector dimension to use in the database and when calling Azure OpenAI." + - name: text-embedding-3-large + parameters: + - name: vectorDimension + type: number + required: true + # https://github.com/stargate/data-api/issues/1241: Docs claim 3072 is max, + # but using values above 1536 does not seem to work. So at least default + # to what seems like a legal value (but leave max higher in case issue is fixed). + default-value: 1536 + validation: + numeric-range: [256, 3072] + help: "Vector dimension to use in the database and when calling Azure OpenAI." + - name: text-embedding-ada-002 + vector-dimension: 1536 + bedrock: + display-name: Amazon Bedrock + enabled: true + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-access-id + forwarded: aws_access_key_id + - accepted: x-embedding-secret-id + forwarded: aws_secret_access_key + SHARED_SECRET: + enabled: false + tokens: + - accepted: accessId + forwarded: aws_access_key_id + - accepted: secretKey + forwarded: aws_secret_access_key + parameters: + - name: "region" + type: string + required: true + help: "AWS region where the model is hosted." + properties: + max-batch-size: 1 + models: + - name: amazon.titan-embed-text-v1 + vector-dimension: 1536 + - name: amazon.titan-embed-text-v2:0 + parameters: + - name: vectorDimension + type: number + required: false + default-value: 1024 + validation: + options: [256, 512, 1024] + help: "Vector dimension to use in the database and when calling Amazon Bedrock Titan V2 embedding model." + huggingface: + # see https://huggingface.co/blog/getting-started-with-embeddings + display-name: Hugging Face - Serverless + enabled: true + url: https://api-inference.huggingface.co/pipeline/feature-extraction/ + supported-authentications: + NONE: + enabled: false + HEADER: enabled: true tokens: - accepted: x-embedding-api-key forwarded: Authorization - SHARED_SECRET: + SHARED_SECRET: enabled: false tokens: - accepted: providerKey forwarded: Authorization - properties: - max-batch-size: 32 - models: - - name: embed-english-v3.0 - vector-dimension: 1024 - - name: embed-english-v2.0 - vector-dimension: 4096 - nvidia: - # see https://docs.api.nvidia.com/nim/reference/nvidia-embedding-2b-infer - display-name: Nvidia - enabled: true - url: https://ai.api.nvidia.com/v1/retrieval/nvidia/embeddings - supported-authentications: - NONE: - enabled: true - properties: - max-batch-size: 8 - models: - - name: NV-Embed-QA - vector-dimension: 1024 - properties: - max-tokens: 512 - - name: a-deprecated-nvidia-embedding-model - vector-dimension: 1024 - api-model-support: - status: DEPRECATED - message: This model has been deprecated, it will be removed in a future release. It is not supported for new Collections or Tables. - - name: a-EOL-nvidia-embedding-model - vector-dimension: 1024 - api-model-support: - status: END_OF_LIFE - message: This model is at END_OF_LIFE status, it is not supported. + properties: + max-batch-size: 32 + models: + - name: sentence-transformers/all-MiniLM-L6-v2 + vector-dimension: 384 + - name: intfloat/multilingual-e5-large + vector-dimension: 1024 + - name: intfloat/multilingual-e5-large-instruct + vector-dimension: 1024 + - name: BAAI/bge-small-en-v1.5 + vector-dimension: 384 + - name: BAAI/bge-base-en-v1.5 + vector-dimension: 768 + - name: BAAI/bge-large-en-v1.5 + vector-dimension: 1024 + huggingfaceDedicated: + # see https://huggingface.co/docs/inference-endpoints/en/supported_tasks#sentence-embeddings + display-name: Hugging Face - Dedicated + enabled: true + url: https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + max-batch-size: 32 + models: + - name: endpoint-defined-model + parameters: + - name: vectorDimension + type: number + required: true + validation: + numeric-range: [2, 3072] + help: "Vector dimension to use in the database, should be the same as the model used by the endpoint." + parameters: + - name: "endpointName" + type: string + required: true + help: "Add the first part of the dedicated endpoint URL" + display-name: "Endpoint name" + hint: "Add endpoint name" + - name: "regionName" + type: string + required: true + help: "Add the second part of the dedicated endpoint URL" + display-name: "Region name" + hint: "Add region name" + - name: "cloudName" + type: string + required: true + help: "Add the third part of the dedicated endpoint URL" + display-name: "Cloud provider where the dedicated endpoint is deployed" + hint: "Add cloud name" + # OUT OF SCOPE FOR INITIAL PREVIEW + vertexai: + # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text + display-name: Google Vertex AI + enabled: false + url: "https://us-central1-aiplatform.googleapis.com/v1/projects/{projectId}/locations/us-central1/publishers/google/models" + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: projectId + type: string + required: true + help: "The Google Cloud Project ID to use when calling" + properties: + task-type-store: RETRIEVAL_DOCUMENT # see https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#api_changes_to_models_released_on_or_after_august_2023 + task-type-read: QUESTION_ANSWERING + max-input-length: 5 + max-batch-size: 32 + models: + - name: textembedding-gecko@003 + vector-dimension: 768 + parameters: + - name: "autoTruncate" + type: boolean + required: false + default-value: true + help: "If set to false, text that exceeds the token limit causes the request to fail. The default value is true." + # OUT OF SCOPE FOR INITIAL PREVIEW + cohere: + # see https://docs.cohere.com/reference/embed + display-name: Cohere + enabled: false + url: https://api.cohere.ai/v1/ + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + max-batch-size: 32 + models: + - name: embed-english-v3.0 + vector-dimension: 1024 + - name: embed-english-v2.0 + vector-dimension: 4096 + nvidia: + # see https://docs.api.nvidia.com/nim/reference/nvidia-embedding-2b-infer + display-name: Nvidia + enabled: true + url: https://ai.api.nvidia.com/v1/retrieval/nvidia/embeddings + supported-authentications: + NONE: + enabled: true + properties: + max-batch-size: 8 + models: + - name: NV-Embed-QA + vector-dimension: 1024 + properties: + max-tokens: 512 + - name: a-deprecated-nvidia-embedding-model + vector-dimension: 1024 + api-model-support: + status: DEPRECATED + message: This model has been deprecated, it will be removed in a future release. It is not supported for new Collections or Tables. + - name: a-EOL-nvidia-embedding-model + vector-dimension: 1024 + api-model-support: + status: END_OF_LIFE + message: This model is at END_OF_LIFE status, it is not supported. - jinaAI: - #see https://jina.ai/embeddings/#apiform - display-name: Jina AI - enabled: true - url: https://api.jina.ai/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - properties: - initial-back-off-millis: 1000 - max-back-off-millis: 1000 - max-batch-size: 32 - models: - - name: jina-embeddings-v2-base-en - vector-dimension: 768 - - name: jina-embeddings-v2-base-de - vector-dimension: 768 - - name: jina-embeddings-v2-base-es - vector-dimension: 768 - - name: jina-embeddings-v2-base-code - vector-dimension: 768 - - name: jina-embeddings-v2-base-zh - vector-dimension: 768 - - name: jina-embeddings-v3 - # https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/ - parameters: - - name: vectorDimension - type: number - required: true - default-value: 1024 - validation: - numeric-range: [1, 1024] - help: "Vector dimension to use in the database and when calling Jina AI." - - name: task - type: string - required: false - default-value: text-matching - help: "Select the downstream task for which the embeddings will be used. The model will return the optimized embeddings for that task. Available options are: retrieval.passage, retrieval.query, separation, classification, text-matching. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." - - name: late_chunking - type: boolean - required: false - default-value: false - help: "Apply the late chunking technique to leverage the model's long-context capabilities for generating contextual chunk embeddings. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." - voyageAI: - # see https://docs.voyageai.com/reference/embeddings-api - # see https://docs.voyageai.com/docs/embeddings - display-name: Voyage AI - enabled: true - url: https://api.voyageai.com/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - - name: "autoTruncate" - type: BOOLEAN - required: false - default-value: true - help: "Whether to truncate the input texts to fit within the context length. Defaults to true." - properties: - max-input-length: 128 - task-type-store: document - task-type-read: query - max-batch-size: 32 - models: - - name: voyage-large-2-instruct - vector-dimension: 1024 - - name: voyage-law-2 - vector-dimension: 1024 - - name: voyage-code-2 - vector-dimension: 1536 - - name: voyage-large-2 - vector-dimension: 1536 - - name: voyage-2 - vector-dimension: 1024 - - name: voyage-finance-2 - vector-dimension: 1024 - - name: voyage-multilingual-2 - vector-dimension: 1024 - mistral: - # see https://docs.mistral.ai/api/#operation/createEmbedding - display-name: Mistral AI - enabled: true - url: https://api.mistral.ai/v1/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - properties: - max-batch-size: 32 - models: - - name: mistral-embed - vector-dimension: 1024 + jinaAI: + #see https://jina.ai/embeddings/#apiform + display-name: Jina AI + enabled: true + url: https://api.jina.ai/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + properties: + initial-back-off-millis: 1000 + max-back-off-millis: 1000 + max-batch-size: 32 + models: + - name: jina-embeddings-v2-base-en + vector-dimension: 768 + - name: jina-embeddings-v2-base-de + vector-dimension: 768 + - name: jina-embeddings-v2-base-es + vector-dimension: 768 + - name: jina-embeddings-v2-base-code + vector-dimension: 768 + - name: jina-embeddings-v2-base-zh + vector-dimension: 768 + - name: jina-embeddings-v3 + # https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/ + parameters: + - name: vectorDimension + type: number + required: true + default-value: 1024 + validation: + numeric-range: [1, 1024] + help: "Vector dimension to use in the database and when calling Jina AI." + - name: task + type: string + required: false + default-value: text-matching + help: "Select the downstream task for which the embeddings will be used. The model will return the optimized embeddings for that task. Available options are: retrieval.passage, retrieval.query, separation, classification, text-matching. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." + - name: late_chunking + type: boolean + required: false + default-value: false + help: "Apply the late chunking technique to leverage the model's long-context capabilities for generating contextual chunk embeddings. For more information, please refer to the Jina AI documentation: https://jina.ai/news/jina-embeddings-v3-a-frontier-multilingual-embedding-model/." + voyageAI: + # see https://docs.voyageai.com/reference/embeddings-api + # see https://docs.voyageai.com/docs/embeddings + display-name: Voyage AI + enabled: true + url: https://api.voyageai.com/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + - name: "autoTruncate" + type: BOOLEAN + required: false + default-value: true + help: "Whether to truncate the input texts to fit within the context length. Defaults to true." + properties: + max-input-length: 128 + task-type-store: document + task-type-read: query + max-batch-size: 32 + models: + - name: voyage-large-2-instruct + vector-dimension: 1024 + - name: voyage-law-2 + vector-dimension: 1024 + - name: voyage-code-2 + vector-dimension: 1536 + - name: voyage-large-2 + vector-dimension: 1536 + - name: voyage-2 + vector-dimension: 1024 + - name: voyage-finance-2 + vector-dimension: 1024 + - name: voyage-multilingual-2 + vector-dimension: 1024 + mistral: + # see https://docs.mistral.ai/api/#operation/createEmbedding + display-name: Mistral AI + enabled: true + url: https://api.mistral.ai/v1/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + properties: + max-batch-size: 32 + models: + - name: mistral-embed + vector-dimension: 1024 - # NOTE: UpstageAI has one model for storing and a diff one for reading: this is different - # from everyone else. For now handling this requires explicit handling by actual - # embedding client implementation: model name here is a prefix for the actual model name. - # In addition, implementation only supports 1-entry vectorization. - upstageAI: - # see https://developers.upstage.ai/docs/apis/embeddings - display-name: Upstage - enabled: true - url: https://api.upstage.ai/v1/solar/embeddings - supported-authentications: - NONE: - enabled: false - HEADER: - enabled: true - tokens: - - accepted: x-embedding-api-key - forwarded: Authorization - SHARED_SECRET: - enabled: false - tokens: - - accepted: providerKey - forwarded: Authorization - parameters: - properties: - max-batch-size: 1 - models: - # NOTE: this is where weirdness exists; model name is prefix on which - # either "-query" or "-passage" is appended to get the actual model name - - name: solar-embedding-1-large - vector-dimension: 4096 + # NOTE: UpstageAI has one model for storing and a diff one for reading: this is different + # from everyone else. For now handling this requires explicit handling by actual + # embedding client implementation: model name here is a prefix for the actual model name. + # In addition, implementation only supports 1-entry vectorization. + upstageAI: + # see https://developers.upstage.ai/docs/apis/embeddings + display-name: Upstage + enabled: true + url: https://api.upstage.ai/v1/solar/embeddings + supported-authentications: + NONE: + enabled: false + HEADER: + enabled: true + tokens: + - accepted: x-embedding-api-key + forwarded: Authorization + SHARED_SECRET: + enabled: false + tokens: + - accepted: providerKey + forwarded: Authorization + parameters: + properties: + max-batch-size: 1 + models: + # NOTE: this is where weirdness exists; model name is prefix on which + # either "-query" or "-passage" is appended to get the actual model name + - name: solar-embedding-1-large + vector-dimension: 4096 diff --git a/src/main/resources/test-reranking-providers-config.yaml b/src/main/resources/test-reranking-providers-config.yaml index 7f1350470a..91ebe9fbd9 100644 --- a/src/main/resources/test-reranking-providers-config.yaml +++ b/src/main/resources/test-reranking-providers-config.yaml @@ -1,31 +1,30 @@ -stargate: - jsonapi: - reranking: - providers: - nvidia: - is-default: true - display-name: Nvidia - enabled: true - supported-authentications: - NONE: - enabled: true - models: - - name: nvidia/llama-3.2-nv-rerankqa-1b-v2 - is-default: true - url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking - properties: - max-batch-size: 10 - - name: nvidia/a-random-deprecated-model - api-model-support: - status: DEPRECATED - message: This model has been deprecated, it will be removed in a future release. It is not supported for new Collections or Tables. - url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking - properties: - max-batch-size: 10 - - name: nvidia/a-random-EOL-model - api-model-support: - status: END_OF_LIFE - message: This model is at END_OF_LIFE status, it is not supported. - url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking - properties: - max-batch-size: 10 \ No newline at end of file +data-api: + reranking: + providers: + nvidia: + is-default: true + display-name: Nvidia + enabled: true + supported-authentications: + NONE: + enabled: true + models: + - name: nvidia/llama-3.2-nv-rerankqa-1b-v2 + is-default: true + url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking + properties: + max-batch-size: 10 + - name: nvidia/a-random-deprecated-model + api-model-support: + status: DEPRECATED + message: This model has been deprecated, it will be removed in a future release. It is not supported for new Collections or Tables. + url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking + properties: + max-batch-size: 10 + - name: nvidia/a-random-EOL-model + api-model-support: + status: END_OF_LIFE + message: This model is at END_OF_LIFE status, it is not supported. + url: https://us-west-2.api-dev.ai.datastax.com/nvidia/v1/ranking + properties: + max-batch-size: 10 \ No newline at end of file From 27def8fcb3ca91a387d76511430824557730e1b5 Mon Sep 17 00:00:00 2001 From: Hazel Date: Tue, 30 Sep 2025 13:51:11 -0700 Subject: [PATCH 4/4] replace STARGATE_JSONAPI to DATA_API --- docker-compose/docker-compose-hcd.yml | 6 +++--- docker-compose/docker-compose.yml | 6 +++--- helm/jsonapi/templates/stargate_jsonapi_deployment.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose/docker-compose-hcd.yml b/docker-compose/docker-compose-hcd.yml index 08f78f3a8a..705d66bd01 100644 --- a/docker-compose/docker-compose-hcd.yml +++ b/docker-compose/docker-compose-hcd.yml @@ -85,11 +85,11 @@ services: - JAVA_MAX_MEM_RATIO=75 - JAVA_INITIAL_MEM_RATIO=50 - GC_CONTAINER_OPTIONS=-XX:+UseG1GC - - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=hcd - - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1 + - DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=hcd + - DATA_API_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1 - QUARKUS_HTTP_ACCESS_LOG_ENABLED=${REQUESTLOG} - QUARKUS_LOG_LEVEL=${LOGLEVEL} - - STARGATE_JSONAPI_OPERATIONS_VECTORIZE_ENABLED=true + - DATA_API_OPERATIONS_VECTORIZE_ENABLED=true - JAVA_OPTS_APPEND=-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager healthcheck: test: curl -f http://localhost:8181/stargate/health || exit 1 diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 4aa8e88ade..ca0e943ee7 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -75,11 +75,11 @@ services: - JAVA_MAX_MEM_RATIO=75 - JAVA_INITIAL_MEM_RATIO=50 - GC_CONTAINER_OPTIONS=-XX:+UseG1GC - - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=dse-1 - - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1 + - DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=dse-1 + - DATA_API_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1 - QUARKUS_HTTP_ACCESS_LOG_ENABLED=${REQUESTLOG} - QUARKUS_LOG_LEVEL=${LOGLEVEL} - - STARGATE_JSONAPI_OPERATIONS_VECTORIZE_ENABLED=true + - DATA_API_OPERATIONS_VECTORIZE_ENABLED=true - JAVA_OPTS_APPEND=-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager healthcheck: test: curl -f http://localhost:8181/stargate/health || exit 1 diff --git a/helm/jsonapi/templates/stargate_jsonapi_deployment.yaml b/helm/jsonapi/templates/stargate_jsonapi_deployment.yaml index bd3edcbf4d..86388a784b 100644 --- a/helm/jsonapi/templates/stargate_jsonapi_deployment.yaml +++ b/helm/jsonapi/templates/stargate_jsonapi_deployment.yaml @@ -48,7 +48,7 @@ spec: cpu: {{ .Values.cpu | default 1000 }}m memory: {{ .Values.memory | default 1024 }}Mi env: - - name: STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS + - name: DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS value: {{ .Values.cassandraEndPoints }} - name: IO_STARGATE_SGV2_API_COMMON_PROPERTIES_DATASTORE_CONFIGURATION_DATASTOREPROPERTIESCONFIGURATION_FETCHSUPPORTEDFEATURES_RETRY_MAXRETRIES value: "50"