Migrate Model definitions to Swagger
This commit is contained in:
parent
c8fd780d6e
commit
a900ad7bcc
@ -2,6 +2,8 @@
|
|||||||
title: Models
|
title: Models
|
||||||
---
|
---
|
||||||
|
|
||||||
|
import ApiSchema from '@theme/ApiSchema';
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
Draft Specification: functionality has not been implemented yet.
|
Draft Specification: functionality has not been implemented yet.
|
||||||
@ -14,7 +16,7 @@ Feedback: [HackMD: Models Spec](https://hackmd.io/ulO3uB1AQCqLa5SAAMFOQw)
|
|||||||
|
|
||||||
Jan's Model API aims to be as similar as possible to [OpenAI's Models API](https://platform.openai.com/docs/api-reference/models), with additional methods for managing and running models locally.
|
Jan's Model API aims to be as similar as possible to [OpenAI's Models API](https://platform.openai.com/docs/api-reference/models), with additional methods for managing and running models locally.
|
||||||
|
|
||||||
### User Objectives
|
### Objectives
|
||||||
|
|
||||||
- Users can start/stop models and use them in a thread (or via Chat Completions API)
|
- Users can start/stop models and use them in a thread (or via Chat Completions API)
|
||||||
- Users can download, import and delete models
|
- Users can download, import and delete models
|
||||||
@ -63,6 +65,8 @@ Jan's `model.json` aims for rough equivalence with [OpenAI's Model Object](https
|
|||||||
|
|
||||||
Jan's `model.json` object properties are optional, i.e. users should be able to run a model declared by an empty `json` file.
|
Jan's `model.json` object properties are optional, i.e. users should be able to run a model declared by an empty `json` file.
|
||||||
|
|
||||||
|
<ApiSchema example pointer="#/components/schemas/Model" />;
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// ./models/zephr/zephyr-7b-beta-Q4_K_M.json
|
// ./models/zephr/zephyr-7b-beta-Q4_K_M.json
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7314,29 +7314,126 @@ components:
|
|||||||
- model
|
- model
|
||||||
- input
|
- input
|
||||||
- voice
|
- voice
|
||||||
|
|
||||||
Model:
|
Model:
|
||||||
title: Model
|
title: Model
|
||||||
description: Describes an OpenAI model offering that can be used with the API.
|
description: Describes an Jan model
|
||||||
properties:
|
properties:
|
||||||
id:
|
type:
|
||||||
|
type: string
|
||||||
|
enum: [model, assistant, thread, message] # This should be specified
|
||||||
|
default: model
|
||||||
|
version:
|
||||||
|
type: integer
|
||||||
|
description: The version of the Model Object file
|
||||||
|
default: 1
|
||||||
|
source_url:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
default: https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf
|
||||||
|
description: The model download source. It can be an external url or a local filepath.
|
||||||
|
id: # OpenAI-equivalent
|
||||||
type: string
|
type: string
|
||||||
description: The model identifier, which can be referenced in the API endpoints.
|
description: The model identifier, which can be referenced in the API endpoints.
|
||||||
|
default: zephyr-7b
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
default: A cool model from Huggingface
|
||||||
|
owned_by: # OpenAI-equivalent
|
||||||
|
type: string
|
||||||
|
description: The organization that owns the model (you!)
|
||||||
|
default: you # TODO
|
||||||
created:
|
created:
|
||||||
type: integer
|
type: integer
|
||||||
description: The Unix timestamp (in seconds) when the model was created.
|
description: The Unix timestamp (in seconds) for when the model was created
|
||||||
object:
|
state:
|
||||||
type: string
|
type: string
|
||||||
description: The object type, which is always "model".
|
enum: [to_download, downloading, ready, running]
|
||||||
enum: [model]
|
default: to_download
|
||||||
owned_by:
|
parameters:
|
||||||
|
type: object
|
||||||
|
description:
|
||||||
|
properties:
|
||||||
|
init:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
ctx_len:
|
||||||
type: string
|
type: string
|
||||||
description: The organization that owns the model.
|
description: TODO
|
||||||
|
default: 2048
|
||||||
|
ngl:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 100
|
||||||
|
embedding:
|
||||||
|
type: bool
|
||||||
|
description: TODO
|
||||||
|
default: true
|
||||||
|
n_parallel:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 4
|
||||||
|
pre_prompt:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: A chat between a curious user and an artificial intelligence
|
||||||
|
user_prompt:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: "USER:"
|
||||||
|
ai_prompt:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: "ASSISTANT:"
|
||||||
|
runtime:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
temperature:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 0.7
|
||||||
|
token_limit:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 2048
|
||||||
|
top_k:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 0
|
||||||
|
top_p:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: 1
|
||||||
|
stream:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
default: true
|
||||||
|
default: {}
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum: [llamacpp, api,tensorrt]
|
||||||
|
default: llamacpp
|
||||||
|
quantization:
|
||||||
|
type: string
|
||||||
|
description: TODO
|
||||||
|
binaries:
|
||||||
|
type: array
|
||||||
|
description: TODO
|
||||||
|
default: {}
|
||||||
required:
|
required:
|
||||||
- id
|
|
||||||
- object
|
- object
|
||||||
- created
|
- source_url
|
||||||
- owned_by
|
- parameters
|
||||||
|
- description
|
||||||
|
- metadata
|
||||||
|
- state
|
||||||
|
- name
|
||||||
|
- id # From OpenAI
|
||||||
|
- object # From OpenAI
|
||||||
|
- created # From OpenAI
|
||||||
|
- owned_by # From OpenAI
|
||||||
x-oaiMeta:
|
x-oaiMeta:
|
||||||
name: The model object
|
name: The model object
|
||||||
example: *retrieve_model_response
|
example: *retrieve_model_response
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user