Skip to content
ACS Infra
Looms

Create Branch

POST
/v1/looms/{loom_id}/nodes/{node_id}/branch

Grow a Branch under a completed Node: n child Nodes, each one Completion of its text. The text of a Node is the text on the path from the root to it. The server writes the new Nodes as their tokens arrive, also when no client is connected. Answers the new Nodes, queued. For a Node that is not completed, 409 and the error object. For a model that the API does not serve, 400 model_not_found, and no Node is made. If your tokens left this month cannot hold one Node's Completion, 429 budget_exceeded and no Node is made.

Authorization

bearer
headerAuthorizationBearer <token>

An API key: Authorization: Bearer sk-acs-..., or a key of the old platform, acs-bm-.... A User makes and revokes keys in the App.

Path Parameters

loom_id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$
Formatuuid
node_id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$
Formatuuid

Header Parameters

idempotency-key?string

A key of your choice, 1 to 255 characters, such as a UUID. A retry with the same key and the same request does the work once: it gets the first answer, and is never charged twice. Kept 24 hours, one set for each User across all their API keys.

Length1 <= length <= 255

Request Body

application/json
  1. body
model*string

The Base model: an id from GET /v1/models, such as llama-8b.

Match^[^\u0000]*$
max_tokens?integer

Generate at most this many tokens for each Node, from 1 to 32000. A Branch generates at most 32000 tokens in all: n × max_tokens.

Range1 <= value <= 32000
temperature?number

Sample less likely tokens more often; 0 takes the most likely token each time. From 0 to 100, as v1 takes it.

Range0 <= value <= 100
logprobs?|

Return the log probabilities of this many top tokens; at most 1000, and 101000 in each Node: max_tokens × (this + 1). max_tokens left out counts as 16.

Range0 <= value <= 1000
top_p?number

Sample from the most likely tokens up to this probability; more than 0 and at most 1, as OpenAI and vLLM take it.

Range0 < value <= 1
top_k?integer

vLLM: sample from this many most likely tokens; 0 or -1 for all.

Range-1 <= value
min_p?number

vLLM: leave out tokens less likely than this fraction of the most likely; from 0 to 1.

Range0 <= value <= 1
presence_penalty?number

Make a token that is already in the text less likely; from -2 to 2.

Range-2 <= value <= 2
frequency_penalty?number

Make a token less likely each time it is already in the text; from -2 to 2.

Range-2 <= value <= 2
repetition_penalty?number

vLLM: divide the scores of repeated tokens by this, more than 0; 1 for none.

Range0 < value
seed?|

From 0. The same seed samples the same tokens; vLLM can still change one now and then when it batches requests.

Range0 <= value
blue_noise?boolean

Sample with blue noise: each draw that picks a token pushes away from the one before, so unlikely tokens come spread out instead of in runs. One step keeps the model's rates, and a whole text leans toward likely tokens. Only on a model whose capabilities.blue_noise is true in GET /v1/models. The seed's low 32 bits key the draws.

stop?|array<>|

Stop before any of these texts; at most 4, none empty.

apply_steering_vectors?array<>|

vllm-lens: add these vectors to the residual stream of each Node, as POST /v1/completions does, with the same fields and on the same models. At most 8 vectors. Each Node keeps the vectors in its request, and each read of the Loom answers them again, so the numbers of their activations × n is at most 131072: one vector of llama-405b for 8 Nodes, or of llama-8b for 32. Steer more Nodes, or with more numbers, through POST /v1/completions.

first_token?|

Start each new Node with this text, then generate up to max_tokens tokens after it.

n?integer

How many child Nodes to make, from 1 to 128.

Range1 <= value <= 128

Response Body

Branch

application/json
  1. response
object*"list"
Value in"list"
data*array<>
Example Request
curl -X POST 'https://api.infra.acsresearch.org/v1/looms/497f6eca-6276-4993-bfeb-53cbbbba6f08/nodes/497f6eca-6276-4993-bfeb-53cbbbba6f08/branch' \  -H 'Authorization: Bearer <API_KEY>' \  -H 'Content-Type: application/json' \  -d '{  "model": "string"}'
Example Response
{  "object": "list",  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "object": "loom.node",      "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",      "status": "queued",      "text": "string",      "logprobs": {        "text_offset": [          0        ],        "token_logprobs": [          0        ],        "tokens": [          "string"        ],        "top_logprobs": [          {            "property1": 0,            "property2": 0          }        ]      },      "error": {        "message": "string",        "type": "string",        "param": "string",        "code": "string",        "retryable": true,        "retry_after_seconds": 0,        "upstream_status": 0,        "request_id": "string"      },      "request": {        "model": "string",        "max_tokens": 32000,        "temperature": 0,        "logprobs": 0,        "top_p": 0,        "top_k": 0,        "min_p": 0,        "presence_penalty": 0,        "frequency_penalty": 0,        "repetition_penalty": 0,        "seed": 0,        "blue_noise": true,        "stop": "string",        "apply_steering_vectors": [          {            "activations": [              [                0              ]            ],            "layer_indices": [              0            ],            "scale": 0,            "norm_match": true,            "position_indices": [              0            ],            "position_spans": [              [                0,                0              ]            ],            "generated_tokens": 1          }        ],        "first_token": {          "token": "string",          "node_id": "6e0bdcac-9717-4a6f-972e-97489dffeb0c"        }      },      "favorite": true,      "created_at": "string",      "from_split": true,      "press_id": "204ebf1f-16e6-431d-8505-068ffe8c2453",      "lane": "A"    }  ]}