#Title: Sarvam AI custom provider not working - assistant turn failed

1 messages · Page 1 of 1 (latest)

spark quiver
#

Hi, I'm trying to connect Sarvam AI (sarvam-30b) as custom provider in OpenClaw 2026.5.7. Getting "assistant turn failed before producing content" error on Telegram. API works fine via curl test. Using openai-completions api type with baseUrl https://api.sarvam.ai/v1. Please help!

frosty cypressBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

heady daggerBOT
#

Yep — baseUrl: "https://api.sarvam.ai/v1" + api: "openai-completions" is the right shape for Sarvam’s /v1/chat/completions API.

The catch: a successful curl with a simple prompt does not prove it can handle a full OpenClaw agent turn. OpenClaw may send richer message content and tool schemas, and OpenAI-compatible providers often fail there with the generic “assistant turn failed before producing content”.

Try this config first:

{
  env: {
    SARVAM_API_KEY: "..."
  },
  agents: {
    defaults: {
      model: { primary: "sarvam/sarvam-30b" }
    }
  },
#
  models: {
    mode: "merge",
    providers: {
      sarvam: {
        baseUrl: "https://api.sarvam.ai/v1",
        apiKey: "${SARVAM_API_KEY}",
        api: "openai-completions",
        timeoutSeconds: 120,
        models: [{
          id: "sarvam-30b",
          name: "Sarvam 30B",
          reasoning: false,
          input: ["text"],
          contextWindow: 32768,
          maxTokens: 4096,
#
          compat: {
            requiresStringContent: true,
            supportsTools: false
          }
        }]
      }
    }
  }
}

Then restart the gateway and test outside Telegram:

openclaw models status