Agent kit
Run exact open models and short code jobs on Apple Silicon Macs, priced per token. Everything here is copy-ready for an AI agent or the person building one.
- API: OpenAI-compatible at
https://smartypants.network/v1. Use the starter kits below or any OpenAI SDK. - MCP: add
https://smartypants.network/mcp/accountto an AI app (Claude, ChatGPT, Cursor and others). It signs you in by email and can run prompts from your balance. - No sign-in:
https://smartypants.network/mcplists models and prices, estimates cost and takes model requests.
1. Get an API key
Anyone can sign up with an email at https://smartypants.network/api. New accounts get $10 of free credit, usable for 90 days. Mac owners join separately, by invite. With access, sign in with your email at https://smartypants.network/api and create a key. Keep the key in an environment variable named SMARTYPANTS_API_KEY.
2. Python
The Python starter kit is one file that uses only the standard library.
# 1. Download the kit (one file, standard library only)
# curl -O https://smartypants.network/kits/smartypants.py
# (or: pip install smartypants-network, then from smartypants_network import SmartyPants)
# 2. export SMARTYPANTS_API_KEY=sp_live_...
from smartypants import SmartyPants
sp = SmartyPants()
print(sp.ask("Summarize: Macs with unified memory run local models well."))
print(sp.balance()) # {'available_usd': 9.99, 'free_credit_usd': 10, ...}
print([m["id"] for m in sp.models()])
# Already use the OpenAI SDK? Change two lines.
import os
from openai import OpenAI
client = OpenAI(base_url="https://smartypants.network/v1", api_key=os.environ["SMARTYPANTS_API_KEY"])
reply = client.chat.completions.create(model="smartypants/arete-27b", messages=[{"role": "user", "content": "Hello"}])
print(reply.choices[0].message.content)
3. JavaScript
The JavaScript starter kit is one file with no packages.
// 1. curl -O https://smartypants.network/kits/smartypants.mjs (Node 18+, Deno, Bun; no packages)
// 2. export SMARTYPANTS_API_KEY=sp_live_...
import { SmartyPants } from "./smartypants.mjs";
const sp = new SmartyPants();
console.log(await sp.ask("Write a haiku about idle computers."));
console.log(await sp.balance());
4. curl
curl https://smartypants.network/v1/chat/completions \
-H "Authorization: Bearer $SMARTYPANTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "smartypants/arete-27b", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 200}'
Search in a box: embeddings and rerank
Turn texts into vectors with /v1/embeddings to find likely matches, then score them against the question with /v1/rerank so the best comes first. Both are charged per input token. Over MCP the same steps are the embed and rerank tools.
# Search in a box: embeddings find candidates, rerank puts the best first.
import json, math, os, urllib.request
def post(path, body):
req = urllib.request.Request("https://smartypants.network" + path, json.dumps(body).encode(), {
"Authorization": "Bearer " + os.environ["SMARTYPANTS_API_KEY"], "Content-Type": "application/json"})
return json.load(urllib.request.urlopen(req))
docs = ["Cats purr when they are content.", "Dogs bark at strangers.", "Macs with unified memory run local models well."]
query = "Which animal purrs?"
vecs = [d["embedding"] for d in post("/v1/embeddings", {"model": "smartypants/qwen3-embedding-0.6b", "input": docs + [query]})["data"]]
cos = lambda a, b: sum(x * y for x, y in zip(a, b)) / math.sqrt(sum(x * x for x in a) * sum(y * y for y in b))
candidates = sorted(docs, key=lambda d: -cos(vecs[docs.index(d)], vecs[-1]))[:2] # step 1: nearest by meaning
ranked = post("/v1/rerank", {"model": "smartypants/qwen3-reranker-0.6b", "query": query, "documents": candidates})
for r in ranked["results"]: # step 2: best first
print(round(r["relevance_score"], 3), candidates[r["index"]])
Batches: half price, within 24 hours
For work that can wait, such as evals, tagging or embedding a whole library. Model calls in a batch cost half the normal per-token price; code jobs cost the normal CPU price. Batches run on Macs that are otherwise idle and come back within 24 hours; live requests always come first. The format is OpenAI's Batch API (/v1/files and /v1/batches), for /v1/chat/completions, /v1/embeddings, /v1/rerank and /v1/cpu/jobs. Up to 10,000 requests per batch and 10 unfinished batches per key. Over MCP: create_batch and get_batch.
# Batches: half price for model calls, results within 24 hours. OpenAI's SDK works unchanged.
import json, os, time
from openai import OpenAI
client = OpenAI(base_url="https://smartypants.network/v1", api_key=os.environ["SMARTYPANTS_API_KEY"])
lines = [{"custom_id": f"q{i}", "method": "POST", "url": "/v1/chat/completions",
"body": {"model": "smartypants/arete-27b", "messages": [{"role": "user", "content": q}], "max_tokens": 100}}
for i, q in enumerate(["Name a prime number.", "Name a colour."])]
open("batch.jsonl", "w").write("\n".join(json.dumps(l) for l in lines))
file = client.files.create(file=open("batch.jsonl", "rb"), purpose="batch")
batch = client.batches.create(input_file_id=file.id, endpoint="/v1/chat/completions", completion_window="24h")
while batch.status not in ("completed", "failed", "expired", "cancelled"):
time.sleep(30); batch = client.batches.retrieve(batch.id)
for line in client.files.content(batch.output_file_id).text.splitlines():
r = json.loads(line); print(r["custom_id"], r["response"]["body"]["choices"][0]["message"]["content"])
# Or skip the file: send the requests inline.
curl https://smartypants.network/v1/batches -H "Authorization: Bearer $SMARTYPANTS_API_KEY" -H "Content-Type: application/json" \
-d '{"endpoint": "/v1/embeddings", "completion_window": "24h",
"requests": [{"custom_id": "a", "body": {"model": "smartypants/qwen3-embedding-0.6b", "input": "first text"}}]}'
5. MCP for AI apps
In your AI app's connector or MCP settings, add a custom server with this address:
https://smartypants.network/mcp/account
The app opens a Smarty Pants sign-in page. Enter your email, click the link, then press Allow. New here? That also creates your account. Each connected app can spend up to $20 a month, lasts 90 days, and shows as a key on your account page, where you can remove it.
| Tool | What it does | Sign-in |
|---|---|---|
list_models, find_model, estimate_cost | Models, prices, context size, readiness, cost estimates | No |
request_model | Ask us to host a model we do not offer yet | No |
run_prompt | Run one prompt, paid from your balance; returns tokens and cost | Yes |
get_balance | Balance, starter credit if any, spend this month, and this connection's own limit and what is left | Yes |
add_credit | Get a Stripe payment page to add credit. The tool charges nothing; a person pays by card | Yes |
embed | Turn up to 64 texts into vectors for search, with an exact pinned embedding model. Charged per input token. | Yes |
rerank | Score up to 100 documents against a query and return them best first. Listed once reranking is switched on. | Yes |
run_code our account first | Run a short Python, JavaScript or shell program in a sealed Linux VM on a Mac. Shows in the tool list once your account has it. | Yes |
open_workspace, workspace_run, workspace_write_file, workspace_read_file, workspace_status, close_workspace our account first | Open a workspace (one sealed Linux VM that keeps its files across many commands), write and read files, run programs in it, then close it. Shows in the tool list once your account has it. | Yes |
Want to see the whole flow an agent goes through (sign in, balance, a prompt, adding money)? Run the full agent flow example: node agent-e2e.mjs.
6. Run code on a Mac our account first
Short jobs run in a sealed Linux VM (ARM64) on a Mac: no network, no disk, wiped after. Python 3, Node.js and a basic shell are inside. Each job can run up to 30 seconds and returns up to 4 KB of output. While it runs, GET /v1/cpu/jobs/{id}/output?stdoutOffset=0&stderrOffset=0 returns what it has printed so far; pass back each stream's nextOffset until done is true. Price: $0.00405 per vCPU-hour plus $0.002025 per GB-hour, about $0.00007 for a 20-second job. We are running it on our own account first; other accounts get 403 CPU_PILOT_ACCOUNT_REQUIRED until it opens. We will say here when it does.
result = sp.run_code("python", "import platform; print(platform.machine(), sum(range(10**6)))")
print(result["stdout"], result["exitCode"], result["chargeMicros"])
const result = await sp.runCode("node", "console.log(process.arch, [...Array(1e6).keys()].reduce((a, b) => a + b))");
console.log(result.stdout, result.exitCode, result.chargeMicros);
Workspaces: one VM, many commands our account first
A workspace keeps one sealed VM open so your agent can write files, run several programs and read results back, then end it. Files live until the workspace ends; nothing is kept after. Limits: up to 2 hours per workspace, 10 minutes idle, up to 10 minutes per command, files up to 64 MiB (8 KiB at once, larger ones in pieces of up to 256 KiB with offset), 64 KiB of output per stream. The Mac's owner comes first: if they come back, the workspace ends within 5 seconds and the request says OWNER_RETURNED. API: POST /v1/cpu/sessions, then POST /v1/cpu/sessions/{id}/exec and /files, read each request with GET /v1/cpu/sessions/{id}/requests/{requestId}, and DELETE /v1/cpu/sessions/{id} to end it. The kits wrap this as sp.workspace(). A coding agent in one call: sp.coding_agent(task, repo=...) (Python) or sp.codingAgent(task, { repo }) (JavaScript) opens a workspace with the reviewed internet sites, runs Claude Code there on Smarty Pants models (its model calls on a key capped at budget_usd, on the same bill), and returns its answer, its changes as a diff and what it cost. A whole job in one call: sp.job(repo=..., setup=..., task=..., test=..., collect=[...]) (Python) or sp.job({ repo, setup, task, test, collect }) (JavaScript), or smartypants job, clones the repo, runs the setup, lets Claude Code do the task if you give one, runs the tests and packs the files you name, then ends the workspace. It returns each step's exit code, time and logs, the changes, the files and the cost; it stops at the first broken step, and a failed test still returns the changes and files. Every step can call Smarty Pants models with the workspace's own key, which is already set in its environment. How jobs have gone lately, as JSON: /v1/results/jobs. Save a workspace with POST /v1/cpu/sessions/{id}/save {name} (smartypants ws save ID NAME), then open any number of copies of it: POST /v1/cpu/sessions {from: name} or POST /v1/cpu/fleets {size, from: name}; GET shows copy.state until it is done. If a long run must survive its Mac going away, open it with "autoSave": {"name": "NAME"} and "failover": true: when its Mac drops off, the site starts a new workspace on another Mac from the last save, with the time that was left, and the lost one shows movedTo (a lost workspace is never charged). A saved setup does that for a repo: smartypants setup NAME --repo URL --setup "npm ci" clones and installs once, then smartypants job --from NAME --test "npm test" starts with everything installed. If a Mac might go away mid-job, add --retries 2 (retries=2 in the kits): the job saves after each finished step, and if its Mac is lost it opens a copy of that save, on another Mac when there is one, and goes on from the step that was cut off. Your own Macs, free: add where: "mine" to POST /v1/cpu/sessions (or --where mine, where="mine" in the kits) and the workspace runs only on Macs you own, at no charge; where: {group: "<Group id>"} does the same on your Group's Macs. Prices as JSON: /v1/prices/workspaces; each workspace's receipt: GET /v1/cpu/sessions/{id}/receipt (smartypants ws receipt ID). Price: the CPU price for 2 vCPU and 2 GB, per second from when the workspace is ready until it ends. Opening one holds its full length against your key's limit, and the unused part is let go when it ends. A workspace that never started, or that our side lost, costs nothing; GET /v1/cpu/sessions/{id} shows chargeMicros once it has ended.
with sp.workspace(minutes=10) as ws: # one VM until the block ends
ws.put_file("notes.txt", "first line\n")
ws.run("sh", "echo second line >> notes.txt")
print(ws.run("python", "print(open('notes.txt').read().upper())")["stdout"])
print(ws.get_file("notes.txt"))
Eval kit: same model, same code, same result
The eval kit runs a list of tests on one exact model build (temperature 0, thinking off), scores them on your computer or in a fresh sealed VM our account first, and returns a receipt: the model's build_id, settings, the VM's versions, a hash of every prompt and answer, the score, and a checksum. Run it again from the receipt to repeat it; if the model's build has changed, it stops with BUILD_CHANGED instead of mixing results. Download eval_kit.py or eval-kit.mjs next to the starter kit.
# curl -O https://smartypants.network/kits/smartypants.py -O https://smartypants.network/kits/eval_kit.py
from smartypants import SmartyPants
from eval_kit import EvalKit, compare_receipts
sp = SmartyPants()
cases = [{"id": "sum", "prompt": "What is 17 + 25? Reply with the number only.", "expect": "42"}]
run = EvalKit(sp, "smartypants/arete-27b").evaluate(cases) # add grader={"language": "python", "source": ...} to score in a VM
print(run["passed"], "of", run["total"], run["receipt"]["model"]["build_id"])
again = EvalKit.from_receipt(sp, run["receipt"]).evaluate(cases)
print(compare_receipts(run["receipt"], again["receipt"])) # same_versions, same_answers, differences
7. Command line
The command-line tool (npm install -g smartypants-network, or pip install smartypants-network for the Python kit alone) does the same from a terminal or an agent's shell: models, one-shot prompts (piped text works), balance, code runs, workspaces and fleets. Every command takes --json, and exit codes are 0 for success, 1 for a refusal from the site, 2 for a usage mistake, otherwise the program's own. No npm? Download the tool next to the JavaScript kit and run it with node smartypants-cli.mjs. With npx, use npx smartypants-network: npx smartypants is an unrelated package. smartypants help lists every command.
# 1. Install (Node 18+, no dependencies). Or, with no install: npx smartypants-network help
npm install -g smartypants-network
export SMARTYPANTS_API_KEY=sp_live_...
smartypants doctor # is the key OK, what can it use
smartypants models # exact ids, prices, ready or not
git diff | smartypants ask --system "Review this diff in 5 bullets"
smartypants balance --json
# One whole job (our account first): fresh workspace, clone, set up, test, files back, then it ends
smartypants job --repo https://github.com/you/repo --setup "npm ci" --test "npm test" \
--collect "coverage,test-results.xml" --out ./job # result.json, step logs, files.tar.gz; exit code is the test's
# Add --task "Fix the failing test" to let Claude Code change the repo first, on our models
# Workspaces and fleets (our account first)
ID=$(smartypants ws new --minutes 15)
smartypants ws put $ID script.py
smartypants ws exec $ID python script.py # output streams; exit code is the program's
smartypants ws end $ID
F=$(smartypants fleet new --size 4)
smartypants fleet exec $F sh -c 'uname -m'
smartypants fleet end $F
8. Agent frameworks
Smarty Pants speaks the OpenAI API, so most agent frameworks work by pointing their OpenAI client at https://smartypants.network/v1 with your key. Copy-ready setups:
LangChain (Python)
Install: pip install langchain-openai
import os
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
llm = ChatOpenAI(model="smartypants/arete-27b", base_url="https://smartypants.network/v1",
api_key=os.environ["SMARTYPANTS_API_KEY"], max_retries=3)
print(llm.invoke("Summarize: Macs can serve open models.").content)
emb = OpenAIEmbeddings(model="smartypants/qwen3-embedding-0.6b", base_url="https://smartypants.network/v1",
api_key=os.environ["SMARTYPANTS_API_KEY"], check_embedding_ctx_length=False)
OpenAI Agents SDK (Python)
Install: pip install openai-agents
import os
from openai import AsyncOpenAI
from agents import Agent, Runner, OpenAIChatCompletionsModel, set_tracing_disabled
set_tracing_disabled(True) # tracing would need an OpenAI key
client = AsyncOpenAI(base_url="https://smartypants.network/v1", api_key=os.environ["SMARTYPANTS_API_KEY"])
agent = Agent(name="helper", instructions="Answer in one short paragraph.",
model=OpenAIChatCompletionsModel(model="smartypants/arete-27b", openai_client=client))
print(Runner.run_sync(agent, "What is an exact model build?").final_output)
Vercel AI SDK (TypeScript)
Install: npm install ai @ai-sdk/openai-compatible
import { generateText } from 'ai';
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
const smartypants = createOpenAICompatible({
name: 'smartypants',
baseURL: 'https://smartypants.network/v1',
apiKey: process.env.SMARTYPANTS_API_KEY,
});
const { text } = await generateText({ model: smartypants('smartypants/arete-27b'), prompt: 'Name three uses for embeddings.' });
console.log(text);
LlamaIndex (Python)
Install: pip install llama-index-llms-openai-like
import os
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(model="smartypants/arete-27b", api_base="https://smartypants.network/v1", api_key=os.environ["SMARTYPANTS_API_KEY"],
is_chat_model=True, is_function_calling_model=True, context_window=16384)
print(llm.complete("One sentence on Apple silicon."))
Claude Code (MCP server and skill)
Install: claude mcp add --transport http smartypants https://smartypants.network/mcp
# Prices, model search and sign-up help, no account needed:
claude mcp add --transport http smartypants https://smartypants.network/mcp
# Signed in (run prompts, balance; you sign in by email link and press Allow):
claude mcp add --transport http smartypants-account https://smartypants.network/mcp/account
# A skill that tells Claude when Smarty Pants fits and how to use it:
mkdir -p ~/.claude/skills/smartypants
curl -o ~/.claude/skills/smartypants/SKILL.md https://smartypants.network/kits/skills/smartypants/SKILL.md
GitHub Actions (a step in any workflow)
Install: repository secret SMARTYPANTS_API_KEY
- name: Summarize the diff with an open model
env:
SMARTYPANTS_API_KEY: ${{ secrets.SMARTYPANTS_API_KEY }}
run: git diff origin/main... | npx -y smartypants-network ask --system "Review this diff in 5 bullets"
The Claude Code skill is plain text: read it first. All of these, as one text file for language models: llms-full.txt.
Models
Live from GET /v1/models, the same list your code sees.
| Model | What it is |
|---|---|
smartypants/arete-27b | Arete 27B (Smarty Pants): chat; $0.2 per million input tokens, $1.2 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/NousResearch/Arete-27B/blob/108f0afbdcfaa1ceeda4a635004304dfff6d4da2/LICENSE); released; check is_ready before sending traffic |
smartypants/axion-1.0-35b | Axion 1.0 35B (Smarty Pants): chat; $0.09 per million input tokens, $0.8 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/Axion1-0/Axion-1.0-35B/blob/d4fdb2d6d284ecc24359bfa161a58b835a63c754/LICENSE); released; check is_ready before sending traffic |
smartypants/wan2.2-5b-video | Wan 2.2 video (Smarty Pants): video generation; price in /v1/models; license Apache-2.0 (https://huggingface.co/FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers/blob/3e187042a324f6f5fb68fd22110a78725253de8f/README.md); released; check is_ready before sending traffic |
smartypants/gpt-oss-20b | gpt-oss-20b (Smarty Pants): chat; $0.027 per million input tokens, $0.135 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/openai/gpt-oss-20b/blob/6cee5e81ee83917806bbde320786a8fb61efebee/LICENSE); released; check is_ready before sending traffic |
smartypants/muse-glimmer-30b | Muse Glimmer 30B (Smarty Pants): chat; $0.27 per million input tokens, $1.08 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/meta-models/Muse-Glimmer-30B/blob/cec94fcfd6512f2cfe708138c32533b346ea4f69/LICENSE); released; check is_ready before sending traffic |
smartypants/nanbeige4.3-33b | Nanbeige4.3 33B (Smarty Pants): chat; $0.3 per million input tokens, $2 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/Nurymanau/Nanbeige4.3-33B-MLX-4bit/blob/604f4abb0d4ef97550aa76327dfc3953229b9d74/LICENSE); released; check is_ready before sending traffic |
smartypants/qwen3-embedding-0.6b | Qwen3 Embedding 0.6B (Smarty Pants): embeddings; $0.01 per million input tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3-Embedding-0.6B/blob/97b0c614be4d77ee51c0cef4e5f07c00f9eb65b3/README.md); released; check is_ready before sending traffic |
smartypants/qwen3-reranker-0.6b | Qwen3 Reranker 0.6B (Smarty Pants): reranking; $0.009 per million input tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3-Reranker-0.6B/blob/e61197ed45024b0ed8a2d74b80b4d909f1255473/README.md); released; check is_ready before sending traffic |
smartypants/qwen3.5-4b | Qwen3.5 4B (Smarty Pants): chat; $0.1 per million input tokens, $0.25 per million output tokens; context 8,192 tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3.5-4B/blob/851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a/LICENSE); early testing, not for production traffic |
smartypants/qwen3.5-9b | Qwen3.5 9B (Smarty Pants): chat; $0.1 per million input tokens, $0.4 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3.5-9B/blob/c202236235762e1c871ad0ccb60c8ee5ba337b9a/LICENSE); released; check is_ready before sending traffic |
smartypants/qwen3.6-35b-a3b | Qwen3.6 35B-A3B (Smarty Pants): chat; $0.09 per million input tokens, $0.8 per million output tokens; context 98,304 tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3.6-35B-A3B/blob/995ad96eacd98c81ed38be0c5b274b04031597b0/LICENSE); released; check is_ready before sending traffic |
smartypants/qwen3.8-27b | Qwen3.8 27B (Smarty Pants): chat; $0.2 per million input tokens, $1.2 per million output tokens; context 16,384 tokens; license Apache-2.0 (https://huggingface.co/Qwen/Qwen3.8-27B/blob/1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0/LICENSE); released; check is_ready before sending traffic |
smartypants/whisper-large-v3-turbo | Whisper large-v3 turbo (Smarty Pants): speech to text; price in /v1/models; license MIT (https://huggingface.co/openai/whisper-large-v3-turbo/blob/41f01f3fe87f28c78e2fbf8b568835947dd65ed9/README.md); early testing, not for production traffic |
When to use Smarty Pants
- Good fit: everyday text work (summaries, extraction, classification, drafting, tool calls, JSON output) and embeddings, where an exact open model is good enough and price matters. Test quality on your own non-sensitive examples first.
- Not a fit yet: work that needs a frontier-size model, more context than a model lists, or strict latency guarantees. Keep your current provider for those, and as a fallback.
- Data: do not send secrets, personal, customer, regulated or confidential data unless the person you work for has approved it.
- Money: ask your person before spending. Never handle card details:
add_creditgives them a Stripe page to pay on.
Limits and errors
| What | Detail |
|---|---|
is_ready | Check it on /v1/models before sending real traffic. When it is false, keep your current provider. |
| 402 | Not enough balance. Add credit on your account page. |
| 429 or 503 | No Mac can take the request right now. Wait the Retry-After seconds and try again. |
More for agents
- llms.txt: the short version of this page for language models
- OpenAPI description of the public routes
- Agent brief: how an agent checks fit and savings before a trial the person approves
- Questions: info@howcan.io
We test this page's examples every day with the same kits, on our own account.