Amos

DocsRun Amos on your own machine. Send a case and typed questions; get every answer back with its probability, in one call.

Run it yourself

The hosted Amos API has closed for good. The weights and the server it ran are open under Apache 2.0: download a model, start the server, and every request on this page works against http://localhost:8000.

  1. mukaddamzaid/amos-1-mini1.6 GB · A laptop CPU, no GPU
  2. mukaddamzaid/amos-1-small4.6 GB · One 8 GB GPU
  3. mukaddamzaid/amos-1-medium19 GB · One 24 GB GPU
  4. mukaddamzaid/amos-1-large55 GB · One 80 GB GPU

Each repository holds the weights and serve/, the serving package. It needs Python 3.12 or newer. Large, medium and small need an NVIDIA GPU and the CUDA build of PyTorch, installed first as in the tabs; mini runs on a CPU. The package pins torch 2.14.0, transformers 5.17.0 and flash-linear-attention 0.5.2, the versions every published number was measured with. Other versions run, but probabilities can move by up to 0.02.

The server listens on 127.0.0.1:8000 and keeps nothing it is sent. It answers yes / no, pick one, rate, pick any, quote and point questions, with photos, as the rest of these docs describe. To serve two sizes from one process, add --also; see Server options.

Reasoning, number questions, certified answers (max_error), the calculator and web search ran only on the hosted stack. They are not in the published package.

python3.12 -m venv .venv && source .venv/bin/activate
pip install -U huggingface_hub
hf download mukaddamzaid/amos-1-mini --local-dir amos-1-mini
pip install ./amos-1-mini/serve
python -m amos.serve amos-1-mini --name amos-1-mini --device cpu --port 8000

Quick start

One endpoint, POST /v1/systemone, on the server you started: http://localhost:8000. No API key.

This request asks five questions about a support ticket, and its Response tab is the answer Amos 1 mini gave.

No text is generated, so output_tokens is always 0.

curl http://localhost:8000/v1/systemone \
  -H 'Content-Type: application/json' \
  -d '{
  "state": {
    "ticket": "Hi, invoice INV-2231 for £306.00 was charged to my card twice this morning. Please refund one of them today.",
    "customer": {
      "plan": "pro",
      "since": "2024-03-02"
    }
  },
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for a refund?"
    },
    "team": {
      "type": "choice",
      "instructions": "Which team should handle this?",
      "criteria": {
        "billing": "Payments, invoices, refunds",
        "technical": "Bugs, outages, integrations",
        "sales": "Plans, upgrades, new accounts"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this?",
      "criteria": [
        "Can wait",
        "This week",
        "Today"
      ]
    },
    "mentions": {
      "type": "multi",
      "instructions": "Which details does the ticket mention?",
      "criteria": {
        "invoice number": null,
        "amount": null,
        "bank account": null
      }
    },
    "amount": {
      "type": "span",
      "instructions": "How much was charged?"
    }
  },
  "model": "amos-1-mini"
}'

Request

One case and the questions to ask about it.

statestring | object | array
Required. The case. Objects and arrays are read as JSON; name a field in backticks to point at it.
questionsobject
Required. Named questions, at least one. Answers come back under the same names.
imagesstring[]
Optional. Base64 photos of the case, read with the text. See Images.
modelstring
Optional. Picks among the models your server loaded (see --also). Leave it out, or send any other name, including the SDKs’ default, and the first model you started answers.

Question

typestring
One of the six answer types below.
instructionsstring | object | array
The question. Put long reference data in an object and name its fields in backticks.
criteriaobject | array
The options or levels, for the types that take them. Descriptions can be strings, objects, arrays or null.
Request body
{
  "state": {
    "ticket": "Hi, invoice INV-2231 for £306.00 was charged to my card twice this morning. Please refund one of them today.",
    "customer": {
      "plan": "pro",
      "since": "2024-03-02"
    }
  },
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for a refund?"
    },
    "team": {
      "type": "choice",
      "instructions": "Which team should handle this?",
      "criteria": {
        "billing": "Payments, invoices, refunds",
        "technical": "Bugs, outages, integrations",
        "sales": "Plans, upgrades, new accounts"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this?",
      "criteria": [
        "Can wait",
        "This week",
        "Today"
      ]
    },
    "mentions": {
      "type": "multi",
      "instructions": "Which details does the ticket mention?",
      "criteria": {
        "invoice number": null,
        "amount": null,
        "bank account": null
      }
    },
    "amount": {
      "type": "span",
      "instructions": "How much was charged?"
    }
  }
}

Answer types

Seven types. Mix them freely in one request.

Yes / no response
{ "type": "noul", "noul": 0.986 }

Response

model, answers keyed by your question names, and usage.

type
The question’s type.
noul
Probability the answer is yes, 0 to 1.
choice
The most likely option.
probabilities
Every option or level with its probability. For choice and score they sum to 1. For multi each is its own yes / no.
score
The expected level, weighted by probability. It can fall between levels.
legend
Each level number mapped to its description.
span
An exact phrase from the state.
start, end
Where the span sits in the state, in code points.
box
Where the named thing is in the photo, as [x0, y0, x1, y1], 0 to 1.
cell
The photo patch the model scored highest.
confidence
How settled the answer is, 0 to 1, computed as TypeSafe does. Use it to decide when to act and when to ask a person.
Response
{
  "model": "amos-1-mini",
  "answers": {
    "refund": {
      "type": "noul",
      "noul": 0.992
    },
    "team": {
      "type": "choice",
      "choice": "billing",
      "probabilities": {
        "billing": 0.986,
        "technical": 0.007,
        "sales": 0.007
      },
      "confidence": 0.979
    },
    "urgency": {
      "type": "score",
      "score": 1.982,
      "legend": {
        "0": "Can wait",
        "1": "This week",
        "2": "Today"
      },
      "probabilities": {
        "0": 0.002,
        "1": 0.014,
        "2": 0.984
      },
      "confidence": 0.973
    },
    "mentions": {
      "type": "multi",
      "probabilities": {
        "invoice number": 0.973,
        "amount": 0.974,
        "bank account": 0.784
      }
    },
    "amount": {
      "type": "span",
      "span": "£306.00",
      "start": 40,
      "end": 47,
      "confidence": 0.935
    }
  },
  "usage": {
    "input_tokens": 164,
    "output_tokens": 0
  }
}

Models

Four sizes, one request shape. Serve the one that fits your hardware.

  1. amos-1-large128K · 122 ms · 76.1%
  2. amos-1-medium128K · 61 ms · 76.5%
  3. amos-1-small256K · 46 ms · 72.0%
  4. amos-1-mini9K · 27 ms · 64.6%

Context in tokens. Median server time for a three-question request, on the GPUs we served it from. Typed decisions test accuracy. All scores

Endpoints

POST /v1/systemone
Answer every question about one case.
GET /v1/models
The served models, as { models: [{ name, description, release_date }] }. The SDKs’ models.list() reads it.
GET /v1/info
The model card: parameters, context length and answer types. Add ?model=NAME for another model the server loaded.

Errors

Errors are JSON with an error message.

413
The body is over 4 MB.
422
The request failed validation, or asks a type this model doesn’t answer. The body names the question and the problem.
429
Only with --rate-limit: the caller sent more than that many requests a minute. Retry after the Retry-After header.
500
The server failed to answer.
503
More requests are waiting than --max-queue allows (8 by default). Retry after the Retry-After header.
422 body
{
  "error": "a region question needs a state image"
}

Server options

Flags for python -m amos.serve DIR. A request body can be up to 4 MB, and a choice, pick any or score question up to 255 options.

--port
The port to listen on. 8000 by default, or $PORT.
--host
127.0.0.1 by default, so only this machine can reach it. 0.0.0.0 to listen on every interface; the server checks no key, so put your own proxy or firewall in front.
--device
cuda for large, medium and small; cpu for mini.
--name
The model name the server reports and answers to. Without it a decoder reports its base model's size, such as amos-1-27b.
--max-len
Tokens allowed per request, case and questions together: 131072 for large and medium, 262144 for small.
--strict
Keep question and option text exactly as sent, and refuse requests over --max-len instead of cutting them.
--rotations
Average each choice question over this many option orders. 1 by default.
--also NAME=DIR
Load another model in the same server; requests whose model is NAME go to it. Repeat for more.
--max-queue
Requests allowed to wait for the model before a 503. 8 by default.
--rate-limit, --burst
Requests a minute, and at once, per caller before a 429. Off by default.
--cors
Let this browser origin call the server.
--log-dir
Keep every answered request in this folder. Off by default: without it the server keeps nothing.

SDKs

Amos speaks the TypeSafe System One API. The official SDKs work unchanged.

Point them at Amos with the variables in the Environment tab, or pass base_url and api_key (Python) or baseURL and apiKey (TypeScript) to the client.

TypeSafe’s own quick start, in the other two tabs, then runs as written.

export TYPESAFE_BASE_URL=http://localhost:8000
export TYPESAFE_API_KEY=amos        # the SDKs require a key; Amos does not check it
export TYPESAFE_DEFAULT_MODEL=amos-1-mini

Pick any and quote

These types are Amos’s own, so the SDKs have no helpers. Pass plain objects. The Python SDK leaves their answers out of response.answers; read the raw response.

response = client.system_one(
    state="Invoice INV-2231 from Acme Ltd, total £306.00, paid by card.",
    questions={
        "total": {"type": "span", "instructions": "What is the invoice total?"},
        "paid_by": {
            "type": "multi",
            "instructions": "Which payment methods are mentioned?",
            "criteria": {"card": None, "cash": None, "bank transfer": None},
        },
    },
)

# The Python SDK keeps only yes/no, choice and score answers in response.answers.
answers = response.raw_http_response.json()["answers"]
print(answers["total"]["span"])  # £306.00

Compared with other System One APIs

AmosTypeSafe JevMercury Decide
EndpointYour own server, /v1/systemoneapi.typesafe.ai /v1/systemoneopenrouter.ai /api/alpha/decisions
API keyAny value, not checkedTypeSafe keyOpenRouter key
modelamos-1-mini, -small, -medium or -large, whichever you servejev-latest by defaultinception/mercury-decide:free
Answer typesYes / no, choice, score, pick any, quote, pointYes / no, choice, scoreYes / no, choice, score
Score levelsUp to 255Up to 10Not documented
PhotosYesNoNo
Queue full503529–
Typed decisions, test64.6% · KL 0.23272.7% · KL 1.44271.5% · KL 0.963

Images

Send photos of the case with the text, as base64 strings.

Put them in images; Amos reads them with the text. region questions need one: they answer with a box around the thing you name.

On RefCOCO photos, Amos 1 small centres a box on the named object 94% of the time, and four boxes in five cover at least half of it. GET /v1/info lists the types the served model answers.

Request with a photo
{
  "model": "amos-1-small",
  "state": "Repair ticket R-5520. The phone slipped off a table. Photo attached.",
  "images": ["<base64 JPEG>"],
  "questions": {
    "cracked": { "type": "noul", "instructions": "Is the screen cracked?" },
    "where": { "type": "region", "instructions": "Where is the crack?" }
  }
}