xai-org/x-algorithm · error · InvalidRequestForSimClustersAnnVariantException

Request with model version ($modelVersion) and embedding typ

Error message

Request with model version ($modelVersion) and embedding type ($embeddingType) cannot be processed by service variant ($actualServiceName). Expected service variant: $expectedServiceName.

What it means

Thrown by SimClustersAnnVariantFilter when the service variant that received the request is not the variant mapped for the given model version and embedding type. The filter uses serviceNameMapper.getServiceName(modelVersion, embeddingType) and rejects mismatches, so each (modelVersion, embeddingType) pair is only served by its designated service variant.

Source

Thrown at simclusters/simclustersann/filters/SimClustersAnnVariantFilter.scala:46

    validateRequest(request)
    service(request)
  }

  private def validateRequest(
    request: Request[SimClustersANNService.GetTweetCandidates.Args]
  ): Unit = {
    val modelVersion = request.args.query.sourceEmbeddingId.modelVersion
    val embeddingType = request.args.query.config.candidateEmbeddingType

    val actualServiceName = serviceIdentifier.service

    val expectedServiceName = serviceNameMapper.getServiceName(modelVersion, embeddingType)

    expectedServiceName match {
      case Some(name) if name == actualServiceName => ()
      case _ =>
        throw InvalidRequestForSimClustersAnnVariantException(
          modelVersion,
          embeddingType,
          actualServiceName,
          expectedServiceName)
    }
  }
}

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Verify the modelVersion and embeddingType in the request and which service variant the client is hitting
  2. Check serviceNameMapper configuration so (modelVersion, embeddingType) maps to the deployed service's name
  3. Send the request to the expected service variant named in the error message
  4. If the variant should serve this pair, update the mapper config and redeploy

Example fix

// before: client configured against wrong variant
client.setService("simclusters-ann-a")
// after: route to variant expected for (modelVersion, embeddingType)
client.setService(expectedServiceName) // from serviceNameMapper
Defensive patterns

Strategy: validation

Validate before calling

val expected = serviceNameMapper.getServiceName(modelVersion, embeddingType)
require(expected.contains(actualServiceName), s"wrong variant, expected $expected")

Try / catch

catch { case e: InvalidRequestForSimClustersAnnVariantException => routeTo(e.expectedServiceName) }

Prevention

When it happens

Trigger: Calling the SimClusters ANN serving endpoint on a service whose name differs from serviceNameMapper's expected name for the request's modelVersion/embeddingType combination (e.g. pointing a client at the wrong variant deployment, or adding a new model version without updating the variant mapping).

Common situations: New model version rolled out but routing/mapper config not updated; staging traffic sent to prod variant or vice versa; embedding type (e.g. unnormalized vs normalized) not supported by the deployed variant.

Related errors


AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28). Data as JSON: /api/errors/d0916635667dc28a. Report an issue: GitHub.