Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const ENDPOINTS: { method: string; path: string; note: string }[] = [
{ method: "GET", path: "/v1/models", note: "neural model index (IMF v1)" },
{ method: "GET", path: "/v1/models/{id}", note: "one model's metadata" },
{ method: "POST", path: "/v1/infer", note: "{model, input} → {output}" },
{ method: "POST", path: "/v1/infer/batch", note: "{model, inputs[]} → per-item results (≤50)" },
{
method: "GET",
path: "/v1/assets/{tag}/{file}",
note: "CORS streaming proxy for release assets",
},
{ method: "POST", path: "/graphql", note: "GraphQL endpoint (introspection enabled)" },
{ method: "GET", path: "/openapi.json", note: "OpenAPI 3.1 document" },
]
Expand Down
46 changes: 46 additions & 0 deletions src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,48 @@ export const OPENAPI = {
},
},
},
"/v1/infer/batch": {
post: {
tags: ["inference"],
summary: "Batch neural inference",
description: "Up to 50 inputs per request against one model; per-item error isolation.",
requestBody: {
required: true,
content: {
"application/json": {
schema: {
type: "object",
properties: {
model: { type: "string" },
inputs: { type: "array", items: { type: "string" }, maxItems: 50 },
},
required: ["model", "inputs"],
},
},
},
},
responses: {
"200": { description: "Per-item results" },
"400": { $ref: "#/components/responses/BadRequest" },
"404": { $ref: "#/components/responses/NotFound" },
},
},
},
"/v1/assets/{tag}/{file}": {
get: {
tags: ["maps"],
summary: "Release asset (CORS proxy)",
description: "Streaming pass-through to GitHub Releases assets with permissive CORS.",
parameters: [
{ name: "tag", in: "path", required: true, schema: { type: "string" } },
{ name: "file", in: "path", required: true, schema: { type: "string" } },
],
responses: {
"200": { description: "Asset bytes" },
"404": { $ref: "#/components/responses/NotFound" },
},
},
},
"/v1/infer": {
post: {
tags: ["inference"],
Expand Down Expand Up @@ -225,6 +267,10 @@ export const OPENAPI = {
description: "Success",
content: { "application/json": { schema: { type: "object" } } },
},
BadRequest: {
description: "Malformed request",
content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } },
},
NotFound: {
description: "Unknown system or model",
content: { "application/json": { schema: { $ref: "#/components/schemas/Error" } } },
Expand Down
Loading