new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

baseten/capabilities

13 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Baseten error handling example

Example of error handling with Baseten: `import { baseten } from '@ai-sdk/baseten'; import { generateText } from 'ai'; try { const { text } = await generateText({ model: baseten('moonshotai/Kimi-K2-Instruct-0905'), prompt: 'Hello, world!' }); } catch (error) { console.error('Baseten API error:', error.message); }`

Generate text with Baseten models

Baseten language models can be used with the `generateText` function. Example: `import { baseten } from '@ai-sdk/baseten'; import { generateText } from 'ai'; const { text } = await generateText({ model: baseten('moonshotai/Kimi-K2-Instruct-0905'), prompt: 'What is the meaning of life? Answer in one sentence.' });`

Stream text with Baseten models

Baseten language models can also be used with the `streamText` function from AI SDK Core.

Baseten embedding models setup

Create models that call the Baseten embeddings API using the `.embeddingModel()` factory method. Embedding models require a dedicated deployment with a custom `modelURL`. Unlike chat models, embeddings cannot use Baseten's default Model APIs and must specify a dedicated model endpoint. Baseten Embeddings Inference deployments are OpenAI-compatible and use plain HTTP by default with no extra dependencies.

Baseten embedMany batch size

Each `embedMany` request sends at most 128 values. `embedMany` automatically splits larger inputs into chunks of 128 and runs them in parallel, allowing you to pass as many values as you like.

Baseten embedding endpoints support

Supported endpoints for embeddings: `/sync` endpoints (with `/v1/embeddings` appended for you) and `/sync/v1` endpoints. Not supported: `/predict` endpoints.

Baseten performance client batching behavior

When using the native performance client, the client handles batching itself, so values are sent in a single call rather than being split at 128.

Baseten embedding models require modelURL error

Calling `baseten.embeddingModel()` without setting a modelURL will throw an error: 'No model URL provided for embeddings. Please set modelURL option for embeddings.'

Baseten /predict endpoint not supported for chat error

Using a `/predict` endpoint URL for chat models will throw an error: 'Not supported. You must use a /sync/v1 endpoint for chat models.'

Baseten /predict endpoint not supported for embeddings error

Using a `/predict` endpoint URL for embeddings will throw an error: 'Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.'

Baseten image models not supported

Image models are not supported by Baseten provider. Attempting to call `baseten.imageModel()` will throw a NoSuchModelError.

Baseten models support matrix

Baseten models and their capabilities: Qwen/Qwen3-235B-A22B-Instruct-2507, deepseek-ai/DeepSeek-V3.1, and moonshotai/Kimi-K2-Instruct-0905 do not support Image Input but all support Object Generation, Tool Usage, and Tool Streaming.

Baseten embedding examples

Baseten supports both single and batch embeddings using the AI SDK. **Single embedding:** ```javascript import { createBaseten } from '@ai-sdk/baseten'; import { embed } from 'ai'; const baseten = createBaseten({ modelURL: 'https://model-{MODEL_ID}.api.baseten.co/sync' }); const embeddingModel = baseten.embeddingModel(); const { embedding } = await embed({ model: embeddingModel, value: 'sunny day at the beach' }); ``` **Batch embeddings:** ```javascript import { createBaseten } from '@ai-sdk/baseten'; import { embedMany } from 'ai'; const baseten = createBaseten({ modelURL: 'https://model-{MODEL_ID}.api.baseten.co/sync' }); const embeddingModel = baseten.embeddingModel(); const { embeddings } = await embedMany({ model: embeddingModel, values: ['sunny day at the beach', 'rainy afternoon in the city', 'snowy mountain peak'] }); ``` Use `embed()` for single values and `embedMany()` for multiple values. Both require initializing Baseten with your model's URL endpoint.

Give your agent this brain