← All integrations

Integration · Mistral

Mistral Prompt Management

Mistral models are powerful; your prompts should keep up. Version, test, and deploy Mistral system prompts without shipping new code.

Integration Example

PromptForge + Mistral in one file

Version, template, and serve Mistral prompts via REST API. Connect PromptForge to Mistral Large, Mistral Small, or any Mixtral model. Store system prompts as versioned templates and fetch them live.

  1. 1
  2. Fetch your versioned, interpolated prompt from the PromptForge REST API with a single fetch() call.
  3. 2
  4. Pass the returned content string directly to the Mistral SDK as the system prompt, no transformation needed.
  5. 3
  6. Update the prompt in the PromptForge dashboard anytime, running applications pick up the change on the next request. No redeployment required.
integration.ts
TypeScript
import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

async function fetchPrompt(expertise: string, domain: string) {
  const res = await fetch(
    "https://www.promptforge-app.com/api/v1/prompts/your-prompt-id",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer pfk_your_api_key",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        version: "latest",
        variables: { expertise, domain },
      }),
    }
  );
  const { content } = await res.json();
  return content as string;
}

// Prompt template in PromptForge (e.g.):
//   You are a {{expertise}} {{domain}} analyst. Provide accurate insights.
// 1. Fetch the system prompt with dynamic variables
const content = await fetchPrompt("senior", "finance");

// 2. Send to Mistral Large with the versioned prompt
//    Swap mistral-large-latest for mistral-small-latest or any Mixtral
//    model without touching the prompt management layer
const completion = await mistral.chat.complete({
  model: "mistral-large-latest",
  messages: [
    { role: "system", content },
    { role: "user", content: "Analyse this earnings report." },
  ],
});

console.log(completion.choices?.[0].message.content);
How It Works

Mistral + PromptForge in Three Steps

Add a prompt management layer to your Mistral integration without refactoring your application.

Step 1

Create your Mistral system prompt template

Write your Mistral system prompt in PromptForge with {{expertise}}, {{domain}}, or {{output_format}} variables. One template can drive multiple Mistral model tiers by changing only the model parameter in your code.

Step 2

Version across model and prompt changes

When Mistral releases new models, prompt wording often needs adjustment. PromptForge's diff view shows you exactly what changed between versions so you can iterate confidently and compare output quality.

Step 3

Fetch at runtime and pass to the Mistral SDK

Call the PromptForge REST API to retrieve the current prompt, then pass it as the `system` message to `mistral.chat.complete`. Update the prompt in the PromptForge dashboard and all running instances pick it up on the next request.

Features

Powerful Prompt Management Features for AI Developers

From simple prompt storage to production-ready APIs with version control, dynamic variables, rollback, and a public gallery.

Dynamic Variables

Use {{variable}} syntax to create reusable prompt templates. Pass different values via API for endless customization across any LLM.

Instant Prompt API

RESTful API endpoint ready in seconds. Fetch any prompt with version pinning and variable interpolation. No redeployment needed.

Rollback with Diff Checker

View a line-by-line diff of every change and roll back to any previous version in one click. Never lose a working prompt again.

Publish to Gallery

Share your best prompts with the community in the public gallery. Get discovered by other developers and grow your personal library.

Start for free, upgrade anytime

No credit card required to get started. Paid plans include a 14-day free trial.

HobbyNo credit card
  • 1k API requests/month
  • 1 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start Managing My Prompts
Starter
14-day free trial
$9/month

No charge until your trial ends

  • 10k API requests/month
  • 5 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Most Popular
Pro
14-day free trial
$29/month

No charge until your trial ends

  • 100k API requests/month
  • 25 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Business
14-day free trial
$49/month

No charge until your trial ends

  • 500k API requests/month
  • 100 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial

Questions? Contact us

FAQ

Mistral + PromptForge: Common Questions

Specific answers for developers integrating PromptForge with Mistral.

How does PromptForge work with Mistral's function calling?

Mistral's function calling relies on a `tools` array passed to the API, this is structural JSON and does not benefit from prompt versioning. However, the system message that instructs the model *when and how* to use tools is natural language that should be versioned. Store that system message in PromptForge and pass it alongside your `tools` array. When you need to change tool-usage instructions, update the PromptForge template, no code deployment required.

Can I manage prompts for Mistral Large vs Mistral Small separately in PromptForge?

Yes, and it is recommended. Mistral Large handles complex, multi-step instructions well; Mistral Small performs better with concise, task-focused prompts. Create a separate PromptForge prompt for each model tier, for example, `mistral-large-analyst` and `mistral-small-classifier`, and version them independently. Pass the relevant prompt ID based on the model you are calling in that request.

Does PromptForge support Mistral's self-hosted deployments (La Plateforme)?

Yes. The Mistral self-hosted API and La Plateforme both accept the same message format. Fetch the prompt text from PromptForge using your server's outbound internet connection, then send it to your self-hosted Mistral endpoint or to `api.mistral.ai`. PromptForge only manages the prompt text, the endpoint you call for inference is entirely your own configuration.

How do I use PromptForge with Mistral's multi-language capabilities?

Mistral models have strong native multilingual capabilities. To serve different languages without duplicating prompts, add a `{{language}}` variable to your PromptForge template and include an instruction like `Always respond in {{language}}.` When you call the PromptForge API via POST, pass `variables: { language: "French" }` or `variables: { language: "German" }` in the request body and the interpolated prompt returned will include the correct language instruction. One template, all languages.