Skip to content

Mixedbread

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Mixedbread OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0

Usage

1
2
3
using Mixedbread;

using var client = new MixedbreadClient(apiKey);

Generate

Basic example showing how to create a client and make a request.

1
using var client = new MixedbreadClient(apiKey);

Embedding Generator Generate Async

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using var client = new MixedbreadClient(apiKey);
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;

// Generate embeddings using the MEAI IEmbeddingGenerator interface.
var embeddings = await generator.GenerateAsync(
    ["Hello, world!"],
    new Meai.EmbeddingGenerationOptions
    {
        ModelId = "mixedbread-ai/mxbai-embed-large-v1",
    });

Embedding Generator Custom Dimensions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
using var client = new MixedbreadClient(apiKey);
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;

// Generate embeddings with custom output dimensions.
var embeddings = await generator.GenerateAsync(
    ["Compact embedding for efficient storage."],
    new Meai.EmbeddingGenerationOptions
    {
        ModelId = "mixedbread-ai/mxbai-embed-large-v1",
        Dimensions = 256,
    });

Embedding Generator Get Service Metadata

1
2
3
4
5
using var client = new MixedbreadClient("test-api-key");
Meai.IEmbeddingGenerator<string, Meai.Embedding<float>> generator = client;

// Retrieve metadata about the embedding provider.
var metadata = Meai.EmbeddingGeneratorExtensions.GetService<Meai.EmbeddingGeneratorMetadata>(generator);

Support

Priority place for bugs: https://github.com/tryAGI/Mixedbread/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Mixedbread/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.