Skip to main content
A
Docs

API Reference

Complete API reference for Anar Eval benchmarking and evaluation endpoints.

Base URL

http://localhost:8007/api/v1

Endpoints

GET
/api/v1/health

Health check — returns service status

GET
/api/v1/benchmarks

List all available benchmarks

GET
/api/v1/benchmarks/{id}

Get benchmark details with questions

POST
/api/v1/eval/run

Start an evaluation run (background execution)

GET
/api/v1/results

List all evaluation results

GET
/api/v1/results/{id}

Get detailed results for a specific evaluation

GET
/api/v1/leaderboard

Model leaderboard with ranked scores

GET /api/v1/benchmarks

List all available benchmarks with their categories, question counts, and descriptions.

curl http://localhost:8007/api/v1/benchmarks

GET /api/v1/benchmarks/{id}

Get full benchmark details including all questions, reference answers, and scoring methods.

curl http://localhost:8007/api/v1/benchmarks/arabic-comprehension

POST /api/v1/eval/run

Start an evaluation run. The evaluation executes in the background — the response returns immediately with evaluation IDs.

Request:

{
  "model_id": "llama-3.3-70b-versatile",
  "provider": "groq",
  "benchmark_ids": ["arabic-comprehension", "gcc-government-knowledge"],
  "temperature": 0.0
}
FieldTypeRequiredDescription
model_idstringYesModel identifier (provider-specific)
providerstringYesInference provider: groq or azure
benchmark_idsstring[]YesBenchmark IDs to evaluate against
temperaturefloatNoLLM temperature. Default: 0.0 (deterministic)

Response:

{
  "eval_ids": ["eval-a1b2", "eval-c3d4"],
  "message": "Started 2 evaluation(s)"
}

Background Execution

Evaluations run asynchronously. Use the results endpoints to check status and retrieve scores once complete. The MAX_CONCURRENT_EVALS setting controls how many evaluations can run in parallel.

GET /api/v1/results

List all evaluation results across all models and benchmarks.

curl http://localhost:8007/api/v1/results

Returns an array of evaluation result summaries including model, provider, benchmark, overall score, and status (running, completed, failed).

GET /api/v1/results/{id}

Get detailed results for a specific evaluation, including per-question scores, model responses, and latency measurements.

curl http://localhost:8007/api/v1/results/eval-a1b2

The detailed result includes:

  • Overall benchmark score
  • Per-question breakdown with model response, reference answer, score, and scoring method
  • Aggregate statistics: average latency, total tokens, pass rate

GET /api/v1/leaderboard

Returns the ranked model leaderboard aggregating all completed evaluations.

curl http://localhost:8007/api/v1/leaderboard

Response:

[
  {
    "rank": 1,
    "model_id": "llama-3.3-70b-versatile",
    "provider": "groq",
    "overall_score": 85.2,
    "benchmark_scores": {
      "arabic-comprehension": 90.0,
      "gcc-government-knowledge": 80.0
    },
    "category_scores": {
      "Language": 90.0,
      "Domain Knowledge": 80.0
    },
    "total_evaluations": 2,
    "avg_latency_ms": 1200,
    "last_evaluated": "2024-01-15T10:30:00Z"
  }
]

Models are ranked by overall_score in descending order. Only models with at least one completed evaluation appear on the leaderboard.

Supported Providers

ProviderConfigModels
groqGROQ_API_KEY, GROQ_BASE_URLllama-3.3-70b-versatile, allam-2-7b, llama-3.1-8b-instant
azureAZURE_API_KEY, AZURE_ENDPOINT, AZURE_DEPLOYMENTgpt-4o-uaenorth

Environment Variables

VariableDefaultDescription
GROQ_API_KEYGroq API key
GROQ_BASE_URLhttps://api.groq.com/openai/v1Groq base URL
GROQ_DEFAULT_MODELllama-3.3-70b-versatileDefault Groq model
AZURE_API_KEYAzure OpenAI API key
AZURE_ENDPOINThttps://aimodels-uaenorth.cognitiveservices.azure.comAzure endpoint
AZURE_DEPLOYMENTgpt-4o-uaenorthAzure deployment name
BENCHMARKS_DIR../benchmarksBenchmark JSON directory
MAX_CONCURRENT_EVALS5Parallel evaluation limit
EVAL_TIMEOUT_SECONDS60Per-question timeout
DEBUGfalseEnable debug logging

MCP Server

Eval exposes a Model Context Protocol server at /mcp, enabling integration with AI assistants and development tools that support the MCP specification.