Support for Llama3.2 models and Swift SDK (#98)

This commit is contained in:
Ashwin Bharambe 2024-09-25 10:29:58 -07:00 committed by GitHub
parent 95abbf576b
commit 56aed59eb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 3745 additions and 630 deletions

View file

@ -21,7 +21,7 @@
"info": {
"title": "[DRAFT] Llama Stack Specification",
"version": "0.0.1",
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-09-23 10:56:42.866760"
"description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-09-23 16:58:41.469308"
},
"servers": [
{
@ -2027,10 +2027,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2053,6 +2063,35 @@
"tool_calls"
]
},
"ImageMedia": {
"type": "object",
"properties": {
"image": {
"oneOf": [
{
"type": "object",
"properties": {
"format": {
"type": "string"
},
"format_description": {
"type": "string"
}
},
"additionalProperties": false,
"title": "This class represents an image object. To create"
},
{
"$ref": "#/components/schemas/URL"
}
]
}
},
"additionalProperties": false,
"required": [
"image"
]
},
"SamplingParams": {
"type": "object",
"properties": {
@ -2115,10 +2154,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2267,6 +2316,28 @@
"required": {
"type": "boolean",
"default": true
},
"default": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
}
},
"additionalProperties": false,
@ -2278,7 +2349,8 @@
"type": "string",
"enum": [
"json",
"function_tag"
"function_tag",
"python_list"
],
"title": "This Enum refers to the prompt format for calling custom / zero shot tools",
"description": "`json` --\n Refers to the json format for calling tools.\n The json format takes the form like\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n\n`function_tag` --\n This is an example of how you could define\n your own user defined format for making tool calls.\n The function_tag format looks like this,\n <function=function_name>(parameters)</function>\n\nThe detailed prompts for each of these formats are added to llama cli"
@ -2309,10 +2381,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2326,6 +2408,11 @@
"content"
]
},
"URL": {
"type": "string",
"format": "uri",
"pattern": "^(https?://|file://|data:)"
},
"UserMessage": {
"type": "object",
"properties": {
@ -2339,10 +2426,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2352,10 +2449,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2455,10 +2562,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -2714,10 +2831,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -3298,11 +3425,6 @@
"engine"
]
},
"URL": {
"type": "string",
"format": "uri",
"pattern": "^(https?://|file://|data:)"
},
"WolframAlphaToolDefinition": {
"type": "object",
"properties": {
@ -3396,10 +3518,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
},
{
@ -3731,10 +3863,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -3888,10 +4030,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -4316,10 +4468,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -4515,10 +4677,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
},
{
@ -5407,10 +5579,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -5460,10 +5642,20 @@
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
},
{
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/ImageMedia"
}
]
}
}
]
@ -6027,32 +6219,32 @@
}
],
"tags": [
{
"name": "Inference"
},
{
"name": "Shields"
},
{
"name": "Models"
},
{
"name": "MemoryBanks"
},
{
"name": "SyntheticDataGeneration"
"name": "BatchInference"
},
{
"name": "RewardScoring"
},
{
"name": "PostTraining"
"name": "SyntheticDataGeneration"
},
{
"name": "Agents"
},
{
"name": "MemoryBanks"
},
{
"name": "Safety"
},
{
"name": "Evaluations"
"name": "Models"
},
{
"name": "Inference"
},
{
"name": "Memory"
@ -6061,14 +6253,14 @@
"name": "Telemetry"
},
{
"name": "Agents"
},
{
"name": "BatchInference"
"name": "PostTraining"
},
{
"name": "Datasets"
},
{
"name": "Evaluations"
},
{
"name": "BuiltinTool",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/BuiltinTool\" />"
@ -6077,6 +6269,10 @@
"name": "CompletionMessage",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/CompletionMessage\" />"
},
{
"name": "ImageMedia",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ImageMedia\" />"
},
{
"name": "SamplingParams",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/SamplingParams\" />"
@ -6117,6 +6313,10 @@
"name": "ToolResponseMessage",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/ToolResponseMessage\" />"
},
{
"name": "URL",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/URL\" />"
},
{
"name": "UserMessage",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/UserMessage\" />"
@ -6221,10 +6421,6 @@
"name": "SearchToolDefinition",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/SearchToolDefinition\" />"
},
{
"name": "URL",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/URL\" />"
},
{
"name": "WolframAlphaToolDefinition",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/WolframAlphaToolDefinition\" />"
@ -6661,6 +6857,7 @@
"FunctionCallToolDefinition",
"GetAgentsSessionRequest",
"GetDocumentsRequest",
"ImageMedia",
"InferenceStep",
"InsertDocumentsRequest",
"LogEventRequest",

View file

@ -210,8 +210,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
- $ref: '#/components/schemas/URL'
mime_type:
@ -273,8 +276,11 @@ components:
items:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
type: array
logprobs:
@ -441,8 +447,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
role:
const: assistant
@ -466,8 +475,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
logprobs:
additionalProperties: false
@ -742,8 +754,11 @@ components:
items:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
type: array
model:
@ -893,6 +908,23 @@ components:
required:
- document_ids
type: object
ImageMedia:
additionalProperties: false
properties:
image:
oneOf:
- additionalProperties: false
properties:
format:
type: string
format_description:
type: string
title: This class represents an image object. To create
type: object
- $ref: '#/components/schemas/URL'
required:
- image
type: object
InferenceStep:
additionalProperties: false
properties:
@ -1041,8 +1073,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
- $ref: '#/components/schemas/URL'
document_id:
@ -1108,8 +1143,11 @@ components:
inserted_context:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
memory_bank_ids:
items:
@ -1545,8 +1583,11 @@ components:
query:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
required:
- bank_id
@ -1562,8 +1603,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
document_id:
type: string
@ -2067,8 +2111,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
role:
const: system
@ -2203,6 +2250,14 @@ components:
ToolParamDefinition:
additionalProperties: false
properties:
default:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description:
type: string
param_type:
@ -2225,6 +2280,7 @@ components:
enum:
- json
- function_tag
- python_list
title: This Enum refers to the prompt format for calling custom / zero shot
tools
type: string
@ -2236,8 +2292,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
tool_name:
oneOf:
@ -2256,8 +2315,11 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
role:
const: ipython
@ -2451,14 +2513,20 @@ components:
content:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
context:
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
- items:
type: string
oneOf:
- type: string
- $ref: '#/components/schemas/ImageMedia'
type: array
role:
const: user
@ -2501,7 +2569,7 @@ info:
description: "This is the specification of the llama stack that provides\n \
\ a set of endpoints and their corresponding interfaces that are tailored\
\ to\n best leverage Llama Models. The specification is still in\
\ draft and subject to change.\n Generated at 2024-09-23 10:56:42.866760"
\ draft and subject to change.\n Generated at 2024-09-23 16:58:41.469308"
title: '[DRAFT] Llama Stack Specification'
version: 0.0.1
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
@ -3739,25 +3807,27 @@ security:
servers:
- url: http://any-hosted-llama-stack.com
tags:
- name: Inference
- name: Shields
- name: Models
- name: MemoryBanks
- name: SyntheticDataGeneration
- name: BatchInference
- name: RewardScoring
- name: PostTraining
- name: SyntheticDataGeneration
- name: Agents
- name: MemoryBanks
- name: Safety
- name: Evaluations
- name: Models
- name: Inference
- name: Memory
- name: Telemetry
- name: Agents
- name: BatchInference
- name: PostTraining
- name: Datasets
- name: Evaluations
- description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" />
name: BuiltinTool
- description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage"
/>
name: CompletionMessage
- description: <SchemaDefinition schemaRef="#/components/schemas/ImageMedia" />
name: ImageMedia
- description: <SchemaDefinition schemaRef="#/components/schemas/SamplingParams" />
name: SamplingParams
- description: <SchemaDefinition schemaRef="#/components/schemas/SamplingStrategy"
@ -3790,6 +3860,8 @@ tags:
- description: <SchemaDefinition schemaRef="#/components/schemas/ToolResponseMessage"
/>
name: ToolResponseMessage
- description: <SchemaDefinition schemaRef="#/components/schemas/URL" />
name: URL
- description: <SchemaDefinition schemaRef="#/components/schemas/UserMessage" />
name: UserMessage
- description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionRequest"
@ -3876,8 +3948,6 @@ tags:
- description: <SchemaDefinition schemaRef="#/components/schemas/SearchToolDefinition"
/>
name: SearchToolDefinition
- description: <SchemaDefinition schemaRef="#/components/schemas/URL" />
name: URL
- description: <SchemaDefinition schemaRef="#/components/schemas/WolframAlphaToolDefinition"
/>
name: WolframAlphaToolDefinition
@ -4233,6 +4303,7 @@ x-tagGroups:
- FunctionCallToolDefinition
- GetAgentsSessionRequest
- GetDocumentsRequest
- ImageMedia
- InferenceStep
- InsertDocumentsRequest
- LogEventRequest