vercel/ai · error

No model URL provided for embeddings. Please set modelURL op

Error message

No model URL provided for embeddings. Please set modelURL option for embeddings.

What it means

Embedding models on Baseten require an explicit modelURL because there is no sensible default embedding endpoint. createEmbeddingModel throws this error when options.modelURL is missing.

Source

Thrown at packages/baseten/src/baseten-provider.ts:226

      } else if (customURL.includes('/predict')) {
        throw new Error(
          'Not supported. You must use a /sync/v1 endpoint for chat models.',
        );
      }
    }

    return new OpenAICompatibleChatLanguageModel(modelId ?? 'chat', {
      ...getCommonModelConfig('chat'),
      errorStructure: basetenErrorStructure,
      includeUsage: true,
      supportsStructuredOutputs: true,
    });
  };

  const createEmbeddingModel = (modelId?: BasetenEmbeddingModelId) => {
    const customURL = options.modelURL;
    if (!customURL) {
      throw new Error(
        'No model URL provided for embeddings. Please set modelURL option for embeddings.',
      );
    }

    if (!customURL.includes('/sync')) {
      throw new Error(
        'Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.',
      );
    }

    // BEI embedding deployments are OpenAI-compatible with no extra settings, so
    // plain HTTP is the default and needs no override.
    const model = new OpenAICompatibleEmbeddingModel(modelId ?? 'embeddings', {
      ...getCommonModelConfig('embedding', customURL),
      errorStructure: basetenErrorStructure,
      // Over HTTP, cap each request and let `embedMany` split and parallelise.
      // The native client does its own batching, so let it take everything at
      // once — `embedMany` treats Infinity as "one call".

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Add modelURL pointing at the BEI embedding deployment's /sync/v1 endpoint.
  2. Create a Baseten embedding (BEI) deployment if none exists.
  3. Use a different provider for embeddings if you cannot host a sync embedding deployment.

Example fix

// before
const baseten = createBaseten({ apiKey });
const model = baseten.textEmbeddingModel('my-embeddings');
// after
const baseten = createBaseten({ apiKey, modelURL: 'https://model-xyz.api.baseten.co/production/sync/v1' });
const model = baseten.textEmbeddingModel('my-embeddings');
Defensive patterns

Strategy: validation

Validate before calling

if (!process.env.BASETEN_MODEL_URL) {
  throw new Error('BASETEN_MODEL_URL (sync/v1 endpoint) is required for Baseten embeddings');
}

Try / catch

try {
  const embeddingModel = baseten.textEmbeddingModel('embeddings');
} catch (e) {
  if (e instanceof Error && e.message.includes('modelURL option for embeddings')) {
    // configure modelURL
  }
}

Prevention

When it happens

Trigger: Calling createBaseten({ apiKey }) without modelURL and then provider.embeddingModel(...) or provider.textEmbeddingModel(...).

Common situations: Configuring baseten for chat only and later adding embeddings; forgetting that embeddings always need modelURL on Baseten.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/4bde8d0e023cad87. Report an issue: GitHub.