Mistral
Use Mistral completion and embedding models with Anvia.
Use @anvia/mistral when you want Mistral chat completion and embedding models through Anvia's normalized runtime.
Completion Model
import { AgentBuilder } from "@anvia/core";
import { MistralClient } from "@anvia/mistral";
const client = new MistralClient({ apiKey });
const model = client.completionModel("mistral-large-latest");
const agent = new AgentBuilder("support", model)
.instructions("Answer support questions clearly.")
.build();
const response = await agent.prompt("Hello!").send();completionModel(...) returns a reusable streaming completion model. Pass it to agents, extractors, or pipeline prompt steps.
Embedding Model
import { embedDocuments } from "@anvia/core/embeddings";
const embeddings = client.embeddingModel("mistral-embed");
const embedded = await embedDocuments(embeddings, documents, {
id: (doc) => doc.id,
content: (doc) => `${doc.title}\n${doc.body}`,
});Use embedding models for document preprocessing and retrieval.
Custom Client Options
Use the constructor when credentials or a custom Mistral server URL come from your own configuration system.
const client = new MistralClient({
apiKey: config.mistral.apiKey,
serverURL: config.mistral.serverURL,
});You can also pass an existing Mistral SDK client when your app already owns provider setup.
Capabilities
| Capability | Example |
|---|---|
| Completion | client.completionModel("mistral-large-latest") |
| Embeddings | client.embeddingModel("mistral-embed") |
| Custom server URL | new MistralClient({ serverURL, apiKey }) |
Mistral v1 support covers text completions, tools, tool choice, structured output, streaming, and embeddings. Image and document file attachments are intentionally rejected until Anvia adds full multimodal mapping for Mistral.
