api.md 1.13 KB
Newer Older
1
2
3
4
5
[Documentation Home](./README.md)

# API

## Generate a Prompt
Matt Williams's avatar
Matt Williams committed
6
**POST /api/generate**
7

Matt Williams's avatar
Matt Williams committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
The **Generate** endpoint takes a JSON object with the following fields:

```
{
  Model: "modelname",
  Prompt: "prompt",
  Context: "context",
}
```

Context is optional, but is used to provide additional context, such as memory of earlier prompts. 

The response is a stream of JSON objects with the following fields:

```
{
  "model": "modelname",
  "created_at": "2023-08-04T08:52:19.385406455-07:00"
  "response": "the current token",
  "done": false
}
```

| field | description |
| --- | --- |
| model | the name of the model |
| created_at | the time the response was generated |
| response | the current token |
| done | whether the response is complete |
37
## Create a Model
Matt Williams's avatar
Matt Williams committed
38
**POST /api/create**
39
40

## List Local Models
Matt Williams's avatar
Matt Williams committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
**GET /api/tags**

### Return Object
```
{
  "models": [
    {
      "name": "modelname:tags",
      "modified_at": "2023-08-04T08:52:19.385406455-07:00",
      "size": size
    }
  ]

}
```
56
57
58
59

## Copy a Model
**/api/copy**

Matt Williams's avatar
Matt Williams committed
60
61
62
## Delete a Model
**/api/delete**

63
64
65
66
## Pull a Model
**/api/pull**

## Push a Model
Matt Williams's avatar
Matt Williams committed
67
68
69
70
71
**/api/push**

## Heartbeat
**/**