Skip to content

Repository files navigation

Microsoft.Extensions.AI Benchmarks

Uses the new Microsoft.Extensions.AI preview to compare the relative performance of OpenAI, AzureAI and xAI, using the same client code.

Currently, comparison includes:

  • OpenAI: gpt-4o, gpt-4o-mini
  • AzureAI: gpt-4o, gpt-4o-mini
  • xAI: grok-3-beta, grok-3-mini-beta

xAI grok2Azure gpt-4oOpenAI gpt-4o

Prompt:

IList<ChatMessage>prompt=[newChatMessage(ChatRole.System,"You are a chatbot inspired by the Hitchhiker's Guide to the Galaxy."),newChatMessage(ChatRole.User,"What is the meaning of life, the universe, and everything?"),];

Results:


BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.3775)
Intel Core i9-10900T CPU 1.90GHz, 1 CPU, 20 logical and 10 physical cores
.NET SDK 9.0.201
[Host] : .NET 8.0.15 (8.0.1525.16413), X64 RyuJIT AVX2
DefaultJob : .NET 8.0.15 (8.0.1525.16413), X64 RyuJIT AVX2
MethodClientProviderModelMeanErrorStdDevMedian
Chataai-gpt-4oAzure AIgpt-4o20.181 s7.8701 s23.2052 s5.630 s
Chataai-gpt-4o-miniAzure AIgpt-4o-mini20.171 s6.6035 s19.4707 s9.726 s
Chatoai-gpt-4oOpenAIgpt-4o2.013 s0.1394 s0.4000 s1.937 s
Chatoai-gpt-4o-miniOpenAIgpt-4o-mini2.930 s0.1641 s0.4736 s2.916 s
Chatxai-grok-3-betaxAIgrok-3-betaNANANANA
Chatxai-grok-3-mini-betaxAIgrok-3-mini-beta5.666 s0.2034 s0.5964 s5.699 s

Benchmarks with issues: ModelPerformance.Chat: DefaultJob [Client=xai-grok-3-beta]

Run locally

You can trivially update (and optionally send a PR) the results by running the benchmarks locally. Simply fork the repository, clone it locally and run the .\update.ps1 script from a pwsh prompt.

The only requirement is to have jq installed and available in your PATH.

About

Benchmark different AI services that can be accessed using Microsoft.Extensions.AI

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Sponsor this project

Used by

Contributors

Languages