{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "eleutherai-lm-evaluation-harness--evaluate-a-served-model-through-its-openai-api",
 "repo": "EleutherAI/lm-evaluation-harness",
 "repo_url": "https://github.com/EleutherAI/lm-evaluation-harness",
 "repo_slug": "eleutherai-lm-evaluation-harness",
 "title": "Evaluate a model you serve behind an API",
 "page_title": "How to evaluate a model you serve behind an API with LM Evaluation Harness",
 "summary": "Point the harness at any OpenAI compatible endpoint, local or hosted, instead of loading weights.",
 "who": "A team that serves models with vLLM or a vendor API.",
 "problem": "Loading the model a second time just to evaluate it wastes a GPU.",
 "outcome": "The same benchmark numbers, measured against what you actually serve.",
 "steps": [
  "Install the API backend with `pip install \"lm_eval[api]\"`",
  "For a hosted model set your key, for example `export OPENAI_API_KEY=YOUR_KEY_HERE`, then run `lm_eval --model openai-completions` with `--model_args model=davinci-002` and `--tasks lambada_openai,hellaswag`",
  "For your own server run `lm_eval --model local-completions --tasks gsm8k --model_args model=facebook/opt-125m,base_url=http://{yourip}:8000/v1/completions,num_concurrent=1,max_retries=3,tokenized_requests=False,batch_size=16`",
  "Sanity check generative tasks with `--limit 10` first, as the README recommends for chat APIs"
 ],
 "agent_prompt": "With EleutherAI/lm-evaluation-harness, evaluate the model behind <my vLLM endpoint> on gsm8k using the local-completions backend, starting with a 10 sample sanity run.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "Flags such as --device apply to local models only and do nothing for hosted ones.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "",
 "requirements": [
  "Python with pip; the base package no longer includes transformers or torch",
  "A model backend extra such as `pip install \"lm_eval[hf]\"`, `pip install \"lm_eval[vllm]\"` or `pip install \"lm_eval[api]\"`",
  "A CUDA GPU for the local model examples, which pass --device cuda:0",
  "An API key in the environment for hosted models"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The hosted route reads an API key from your environment, so keep it out of committed code."
  },
  {
   "tag": "cost",
   "notice": "Every evaluated sample is a billed API call on a hosted model."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/eleutherai-lm-evaluation-harness/evaluate-a-served-model-through-its-openai-api/",
 "md": "https://dedupedai.com/use-cases/eleutherai-lm-evaluation-harness/evaluate-a-served-model-through-its-openai-api/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/eleutherai-lm-evaluation-harness--evaluate-a-served-model-through-its-openai-api.json",
 "api_version": "v1"
}
