Skip to main content
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog

Loading…

Servers Are Up

Your apps, automation and data on hardware we own. Build a private stack with predictable capacity and access through your dashboard, API or SSH.

SLA with service creditsOwned hardwareUS-based

Make room for your next idea

Explore the capacity, apps and access options that fit your workload. Check current availability and your total before you buy.

Sign up freeView Pricing

Products

  • Linux VPS
  • Windows VPS
  • Cloud & SaaS Services
  • Cloud Storage (Azure)
  • Virtual Datacenter
  • AI & Agent Hosting
  • Containers
  • Instant Apps
  • Software Platforms
  • Network builder
  • Game Servers
  • Free Game Servers
  • Pricing

Resources

  • Free Network Tools
  • 2026 Pricing Benchmark
  • Live SVG Badges
  • Latency & Speed Test
  • Guides & Tutorials
  • Documentation
  • API Reference
  • MCP Server
  • CLI & SDKs
  • OpenAPI & llms.txt
  • Use Cases
  • Free Migration
  • Uptime & Reliability
  • Datacenter
  • System Status
  • Network
  • Provider Comparisons Hub
  • Compare Providers

Company

  • About Us
  • Enterprise
  • Security Architecture
  • Trust Center
  • Blog
  • FAQ
  • Compliance
  • Startup Program
  • Open-Source Sponsorship
  • Press & Media Kit
  • Referral Program
  • Help Center
  • Contact Us
© Servers Are Up
TermsPrivacySLARefund PolicyDPAAcceptable Use
Service information
Docs
  • Documentation Hub
  • Technical Knowledge Library
    Runbooks & 187 Blueprints
  • Choose a Product
    VMs, Containers & Cloud
  • First Linux Server
    SSH, Firewall & Apps
  • Windows Server 2025
    BYOL & Remote Desktop
  • Remote Access
  • Troubleshooting
  • FAQ
  • All Product Guides
    29 Step-by-Step Guides
  • Cloud & SaaS Catalog
    112 Cloud & SaaS Offerings
  • Azure Cloud Storage
    Hot/Cool/Archive & WORM
  • Resource Manager & RBAC
    Groups, Tags & Locks
  • Multi-Model Cloud DB
    JSONB, SQL & pgvector
  • Cloud Identity & ZTNA
    OIDC, SCIM & PIM
  • Key Vault & KMS
    Secrets & Envelope Keys
  • Cloud SIEM, SOAR & DLP
    Posture & Threat Response
  • API Gateway & Cloud DNS
    Edge WAF & DNS Zones
  • Serverless, Workflows & IoT
    Functions, Queues & DAGs
  • SaaS, Governance & Vault
    Budgets & Off-Host GRS
  • Linux Systems & Kernel
    SSH, UFW, sysctl & OOM
  • Self-Hosted Apps & Stacks
    Caddy, Nextcloud & Auth
  • Build Web Apps with AI
  • Next.js and React
  • TypeScript and Node.js
  • npm and Tooling
  • Data and APIs
  • Deploy and Operate
  • Tutorials
  • Infrastructure
  • Automation & Regions
  • API Overview
  • API v1 Reference
    Endpoints & 23 Scopes
  • MCP Server
    129 AI Agent Tools
  • Swagger / OpenAPI 3.1
  • API Playground
  • Versioning & Sunset
  • API Token Security
    Authentication & Tokens
  • Instances API
    Compute Resources
  • Networking API
    Networks & Ports
  • Storage API Availability
    Volumes & Backups
  • Webhooks & Events
    Event Notifications
  • Rate Limits & Best Practices
    Throttling & Retries
  • sau CLI Reference
    34 Commands (v0.2)
  • Browser Web CLI
  • SDKs
  • Infrastructure as Code
    Terraform & Ansible
  • Code Examples
  • CLI & SDK Guides
  • Security Guides
  • Security at a Glance
  • Zero Trust Architecture
  • Live Trust Center
  • Compliance
Need help?

Loading documentation...

Documentation/ai web apps

Choose a model for your app by measuring it

Pick a model for a feature from your own examples: how often it is right, how long it takes and what it costs, written down so the choice can be changed later.

Intermediate
30 min
Updated 2026-10-27

Deploy Ready-to-Run Infrastructure in Seconds

Linux VMs from $6/mo · Pooled Virtual Datacenters from $12/mo · Use code WELCOME20 for 20% off your first order.

Browse ServersView Pricing

Commands checked on 2026-10-27 with Node.js 24, openai 7.32.

What you will have at the end

A small evaluation you can run against any model with an OpenAI-compatible API: your own examples, a script that asks each candidate model every example and prints how many it got right, its median response time, the tokens it used and what 1,000 requests would cost. You will pick a model from those numbers and write the choice down with the date, so the next person can run the same check when a new model or a new price appears.

Before you start

  • Node.js 24 or newer.
  • One or more models you might use, each with an OpenAI-compatible API: the base address, the model name and an API key in an environment variable. Most providers publish this form of API; your own model server can too.
  • Each provider's price per million input tokens and per million output tokens, from its pricing page. Prices change, so read them on the day you run the comparison.

Steps

1. Write down what the feature needs

Before comparing models, write four facts about the feature, because they decide which numbers matter:

  • The task. Classify, extract, summarise, answer, write code. Small models often do classification and extraction well; long reasoning and code need larger ones.
  • The input size. The longest prompt the feature will send, in tokens. A model whose context window is smaller than that cannot be used at all.
  • The time budget. How long a visitor will wait. A streamed answer can start sooner than it finishes, so note both.
  • The quality bar. How often the model must be right. For a feature with no human checking the result, the bar is high.

2. Make a set of examples from real cases

Ten to fifty examples drawn from what the feature will really see are worth more than any public benchmark. Each line holds a prompt and a short text the right answer must contain.

mkdir -p ~/model-eval && cd ~/model-eval
npm init -y >/dev/null
npm install openai@7.32.0
cat > examples.jsonl <<'EOF'
{"input": "What is 17 times 23? Answer with the number only.", "expect": "391"}
{"input": "Which HTTP status code means Not Found? Answer with the number only.", "expect": "404"}
{"input": "Extract the year from this sentence: The company was founded in March 2014 in Dallas. Answer with the year only.", "expect": "2014"}
{"input": "Is 70000 a valid TCP port number? Answer yes or no.", "expect": "no"}
EOF

Replace these four with your own. Choose expect texts that only a right answer contains.

3. List the candidates

One entry per model. apiKeyEnv names the environment variable that holds its key, so no key is written in the file. The prices are dollars per million tokens, copied from the provider's page.

cat > candidates.json <<'EOF'
[
  { "name": "candidate-a", "baseURL": "YOUR_BASE_URL", "model": "YOUR_MODEL", "apiKeyEnv": "MODEL_A_KEY", "inputPerMTok": 0.5, "outputPerMTok": 1.5 }
]
EOF

Add a second and third entry for the other models you are considering, each with its own key variable.

4. Write the script that runs the comparison

For every candidate it sends each example, checks the answer, and reads the token counts the API reports with every answer.

cat > eval.mjs <<'EOF'
import { readFileSync } from "node:fs";
import OpenAI from "openai";

const examples = readFileSync("examples.jsonl", "utf8").trim().split("\n").map((line) => JSON.parse(line));
const candidates = JSON.parse(readFileSync("candidates.json", "utf8"));

for (const c of candidates) {
  const client = new OpenAI({ apiKey: process.env[c.apiKeyEnv], baseURL: c.baseURL });
  let passed = 0, tokensIn = 0, tokensOut = 0;
  const times = [];
  for (const example of examples) {
    const started = Date.now();
    const reply = await client.chat.completions.create({
      model: c.model,
      messages: [{ role: "user", content: example.input }],
      max_tokens: 1000,
    });
    times.push(Date.now() - started);
    const text = reply.choices[0]?.message?.content ?? "";
    if (text.toLowerCase().includes(example.expect.toLowerCase())) passed += 1;
    tokensIn += reply.usage?.prompt_tokens ?? 0;
    tokensOut += reply.usage?.completion_tokens ?? 0;
  }
  times.sort((a, b) => a - b);
  const median = times[Math.floor(times.length / 2)];
  const costPer1000 = (1000 / examples.length) * (tokensIn * c.inputPerMTok + tokensOut * c.outputPerMTok) / 1e6;
  console.log(`${c.name}: ${passed}/${examples.length} right, median ${(median / 1000).toFixed(1)} s, ` +
    `${Math.round(tokensIn / examples.length)} tokens in and ${Math.round(tokensOut / examples.length)} out per request, ` +
    `$${costPer1000.toFixed(2)} per 1,000 requests`);
}
EOF

5. Run it

export MODEL_A_KEY='YOUR_API_KEY'
node eval.mjs

Each candidate prints one line: how many examples it got right, its median time, the tokens per request in and out, and the cost of 1,000 requests at the prices you entered. A model that reasons before it answers counts its reasoning as output tokens, so its line shows more output, more time and more cost for the same answer.

6. Decide, and write the decision down

Take the cheapest candidate that meets the quality bar and the time budget. Then record it next to the code, so the reason survives:

cat > MODEL_CHOICE.md <<'EOF'
# Model for the answer feature

Chosen: candidate-a (YOUR_MODEL at YOUR_BASE_URL), on the date you ran it.
Measured with model-eval: paste its line from node eval.mjs here.
Rejected: paste each other candidate's line, with why it lost.
Run node eval.mjs again before changing model, and when a provider changes its prices.
EOF

Keep the model's name in a setting, not in the code, so changing model is a change of one value.

Check that it works

Run the comparison twice and check that the counts agree:

node eval.mjs
node eval.mjs

The number right should match between runs. If it moves, the examples are too few or too vague to tell models apart: add more, or make each expect text something only a right answer contains.

What can go wrong

  • Missing credentials. Please pass an apiKey. The variable named in apiKeyEnv is empty in this shell, so the SDK stops before it sends anything. export it again in the same terminal you run the script from.
  • 401 or Incorrect API key. The provider refused the key: it is wrong, revoked, or for another provider.
  • 404 or model not found. The model name or the base address is wrong for that provider; most list their models at YOUR_BASE_URL/models.
  • Every count of tokens is 0. The provider does not report usage on this kind of request, so the cost line is wrong. Check its documentation for a usage option.
  • A model scores well on these examples and badly in use. The examples are not the cases the feature meets. Add the failures you see in use to examples.jsonl and run it again.
  • A request fails with 429. The provider limits requests per minute. Run fewer candidates at once, or wait and run again.

Good practice

  • Measure on your own examples; a public benchmark describes someone else's task.
  • Read prices on the day you compare, and record them with the result.
  • Prefer the smallest model that meets the bar: it is usually faster and cheaper, and you can move up when the examples show you must.
  • Re-run the comparison before every model change, and keep the examples in the repository with the feature.
  • Know where each provider keeps the prompts you send, and choose accordingly for personal or confidential data.

Where to go next

  • Add a first AI feature to a Next.js app
  • Keep secrets out of code, logs and images
  • Use the lockfile so every machine installs the same tree

Related Articles

Run Dify, Flowise, and Langflow workflows cleanly in Docker

Read more

Add a first AI feature to a Next.js app

Read more

Build zero-trust input and output guardrails for AI apps

Read more

Frequently Asked Questions

What does the Choose a model for your app by measuring it documentation guide cover?
Pick a model for a feature from your own examples: how often it is right, how long it takes and what it costs, written down so the choice can be changed later. It is rated intermediate difficulty (30 min) and applies to Servers Are Up infrastructure and workflows.
Can I manage or automate these steps through the Servers Are Up dashboard, REST API v1, or MCP server?
Yes. Every Servers Are Up server includes browser-based SSH, WebRDP, and VNC console access in the dashboard, plus programmatic control via the REST API v1 (/api/v1) and hosted Model Context Protocol server (/api/mcp/v1) using a scoped Personal Access Token.

Need hands-on help with Choose a model for your app by measuring it?

Every Servers Are Up virtual machine and container includes an integrated HTML5 browser-based SSH, RDP, and VNC console in your dashboard, default-off inbound firewall rules with per-IP allow-lists, and full programmatic control via REST API v1 and Model Context Protocol (MCP). Explore our Virtual Datacenter Plans or reach out to Servers Are Up Support.

Was this article helpful?

On this page

What you will have at the endBefore you startSteps1. Write down what the feature needs2. Make a set of examples from real cases3. List the candidates4. Write the script that runs the comparison5. Run it6. Decide, and write the decision downCheck that it worksWhat can go wrongGood practiceWhere to go next
Need Live Commands?

Open Aria in Wide Engineering Mode for distro-specific commands, compose tweaks, and isolated environment troubleshooting.

Knowledge Library