From 666a6143cb2ede6dea79577bf78d8f375c60f7a3 Mon Sep 17 00:00:00 2001
From: Daniel <101145494+dan-jan@users.noreply.github.com>
Date: Sun, 19 Nov 2023 13:06:12 +0800
Subject: [PATCH] Add fields to Model swagger
---
docs/docs/specs/models.md | 45 +--------------------------------------
docs/openapi/jan.yaml | 29 +++++++++++++++++++++++--
2 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/docs/docs/specs/models.md b/docs/docs/specs/models.md
index 3d2c39b89..b7dcd758f 100644
--- a/docs/docs/specs/models.md
+++ b/docs/docs/specs/models.md
@@ -65,50 +65,7 @@ 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.
-;
-
-```json
-// ./models/zephr/zephyr-7b-beta-Q4_K_M.json
-{
- "source_url": "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf",
- "parameters": {
- "init": {
- "ctx_len": "2048",
- "ngl": "100",
- "embedding": "true",
- "n_parallel": "4",
- "pre_prompt": "A chat between a curious user and an artificial intelligence",
- "user_prompt": "USER: ",
- "ai_prompt": "ASSISTANT: "
- },
- "runtime": {
- "temperature": "0.7",
- "token_limit": "2048",
- "top_k": "0",
- "top_p": "1",
- "stream": "true"
- }
- },
- "metadata": {
- "engine": "llamacpp",
- "quantization": "Q4_K_M",
- "size": "7B",
- }
-}
-```
-
-| Property | Type | Description | Validation |
-| ----------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------ |
-| `object` | enum: `model`, `assistant`, `thread`, `message` | Type of the Jan Object. Always `model` | Defaults to "model" |
-| `source_url` | string | The model download source. It can be an external url or a local filepath. | Defaults to `pwd`. See [Source_url](#Source_url) |
-| `parameters` | map | Defines default model run parameters used by any assistant. | Defaults to `{}` |
-| `description` | string | A vanity description of the model | Defaults to "" |
-| `metadata` | map | Stores additional structured information about the model. | Defaults to `{}` |
-| `metadata.engine` | enum: `llamacpp`, `api`, `tensorrt` | The model backend used to run model. | Defaults to "llamacpp" |
-| `metadata.quantization` | string | Supported formats only | See [Custom importers](#Custom-importers) |
-| `metadata.binaries` | array | Supported formats only. | See [Custom importers](#Custom-importers) |
-| `state` | enum[`to_download` , `downloading`, `ready` , `running`] | Needs more thought | Defaults to `to_download` |
-| `name` | string | A vanity name | Defaults to filename |
+
### Model Source
diff --git a/docs/openapi/jan.yaml b/docs/openapi/jan.yaml
index 34660b5a6..8cdbbc48a 100644
--- a/docs/openapi/jan.yaml
+++ b/docs/openapi/jan.yaml
@@ -7384,6 +7384,15 @@ components:
type: string
description: TODO
default: "ASSISTANT:"
+ default: {
+ ctx_len: 2048,
+ ngl: 100,
+ embedding: true,
+ n_parallel: 4,
+ pre_prompt: "A chat between a curious user and an artificial intelligence",
+ user_prompt: "USER:",
+ ai_prompt: "ASSISTANT:"
+ }
runtime:
type: object
properties:
@@ -7407,7 +7416,13 @@ components:
type: string
description: TODO
default: true
- default: {}
+ default: {
+ temperature: 0.7,
+ token_limit: 2048,
+ top_k: 0,
+ top_p: 1,
+ stream: true
+ }
metadata:
type: object
properties:
@@ -7418,10 +7433,20 @@ components:
quantization:
type: string
description: TODO
+ default: Q4_K_M
+ size:
+ type: string
+ default: 7b
binaries:
type: array
description: TODO
- default: {}
+ default: TODO
+ default: {
+ engine: llamacpp,
+ quantization: Q4_K_M,
+ size: 7b,
+ binaries: TODO
+ }
required:
- object
- source_url