Skip to content

Commit

Permalink
Add fields to Model swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-menlo committed Nov 19, 2023
1 parent a900ad7 commit 666a614
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 46 deletions.
45 changes: 1 addition & 44 deletions docs/docs/specs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<ApiSchema example pointer="#/components/schemas/Model" />;

```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 |
<ApiSchema example pointer="#/components/schemas/Model" />

### Model Source

Expand Down
29 changes: 27 additions & 2 deletions docs/openapi/jan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 666a614

Please sign in to comment.