Upload api/openapi.yaml with huggingface_hub
Browse files- api/openapi.yaml +97 -0
api/openapi.yaml
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
openapi: 3.0.0
|
| 2 |
+
info:
|
| 3 |
+
title: dispatchAI Inference API
|
| 4 |
+
description: |
|
| 5 |
+
Mobile-optimized LLM inference on real Snapdragon hardware.
|
| 6 |
+
10x cheaper than OpenAI. 46 tokens/sec on phone.
|
| 7 |
+
UAE-built. Small. Mobile. Free.
|
| 8 |
+
version: 1.0.0
|
| 9 |
+
contact:
|
| 10 |
+
name: dispatchAI
|
| 11 |
+
url: https://huggingface.co/dispatchAI
|
| 12 |
+
servers:
|
| 13 |
+
- url: https://api.dispatchai.ai/v1
|
| 14 |
+
description: Production
|
| 15 |
+
paths:
|
| 16 |
+
/chat/completions:
|
| 17 |
+
post:
|
| 18 |
+
summary: Chat Completion
|
| 19 |
+
description: Create a chat completion (OpenAI-compatible)
|
| 20 |
+
security:
|
| 21 |
+
- apiKeyAuth: []
|
| 22 |
+
requestBody:
|
| 23 |
+
required: true
|
| 24 |
+
content:
|
| 25 |
+
application/json:
|
| 26 |
+
schema:
|
| 27 |
+
type: object
|
| 28 |
+
properties:
|
| 29 |
+
model:
|
| 30 |
+
type: string
|
| 31 |
+
default: dispatchAI/SmolLM2-135M-Instruct-mobile
|
| 32 |
+
enum:
|
| 33 |
+
- dispatchAI/SmolLM2-135M-Instruct-mobile
|
| 34 |
+
- dispatchAI/Qwen2.5-0.5B-Instruct-mobile-int4
|
| 35 |
+
- dispatchAI/Llama-3.2-1B-Instruct-Q4-mobile
|
| 36 |
+
messages:
|
| 37 |
+
type: array
|
| 38 |
+
items:
|
| 39 |
+
type: object
|
| 40 |
+
properties:
|
| 41 |
+
role:
|
| 42 |
+
type: string
|
| 43 |
+
enum: [user, assistant, system]
|
| 44 |
+
content:
|
| 45 |
+
type: string
|
| 46 |
+
max_tokens:
|
| 47 |
+
type: integer
|
| 48 |
+
default: 100
|
| 49 |
+
temperature:
|
| 50 |
+
type: number
|
| 51 |
+
default: 0.7
|
| 52 |
+
responses:
|
| 53 |
+
'200':
|
| 54 |
+
description: Successful response
|
| 55 |
+
content:
|
| 56 |
+
application/json:
|
| 57 |
+
schema:
|
| 58 |
+
type: object
|
| 59 |
+
properties:
|
| 60 |
+
id:
|
| 61 |
+
type: string
|
| 62 |
+
choices:
|
| 63 |
+
type: array
|
| 64 |
+
items:
|
| 65 |
+
type: object
|
| 66 |
+
properties:
|
| 67 |
+
message:
|
| 68 |
+
type: object
|
| 69 |
+
properties:
|
| 70 |
+
role:
|
| 71 |
+
type: string
|
| 72 |
+
content:
|
| 73 |
+
type: string
|
| 74 |
+
usage:
|
| 75 |
+
type: object
|
| 76 |
+
properties:
|
| 77 |
+
prompt_tokens:
|
| 78 |
+
type: integer
|
| 79 |
+
completion_tokens:
|
| 80 |
+
type: integer
|
| 81 |
+
total_tokens:
|
| 82 |
+
type: integer
|
| 83 |
+
/models:
|
| 84 |
+
get:
|
| 85 |
+
summary: List Models
|
| 86 |
+
description: List all available models
|
| 87 |
+
security:
|
| 88 |
+
- apiKeyAuth: []
|
| 89 |
+
responses:
|
| 90 |
+
'200':
|
| 91 |
+
description: List of models
|
| 92 |
+
components:
|
| 93 |
+
securitySchemes:
|
| 94 |
+
apiKeyAuth:
|
| 95 |
+
type: apiKey
|
| 96 |
+
in: header
|
| 97 |
+
name: Authorization
|