-
Notifications
You must be signed in to change notification settings - Fork 3
/
ollama.wit
78 lines (66 loc) · 1.67 KB
/
ollama.wit
1
2
3
4
5
6
7
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package ollama:llm;
interface llm {
record message {
role: string,
content: string
}
record chat-request {
model: string,
messages: list<message>,
with-stream: option<bool>,
format: string,
options: list<tuple<string, string>>
}
record chat-response {
model: string,
created-at: u64,
message: message,
done: bool,
total-duration: u64,
load-duration: u64,
prompt-eval-count: u32,
prompt-eval-duration: u32,
eval-count: u32,
eval-duration: u32
}
record status-error {
status-code: u32,
status: string,
error: string
}
record show-request {
name: string,
model: string,
system: string,
template: string,
options: list<tuple<string, string>>
}
record show-response {
license: string,
modelfile: string,
parameters: string,
template: string,
system: string,
details: model-details
}
record model-details {
format: string,
family: string,
families: list<string>,
parameter-size: string,
quantization-level: string
}
record model-response {
name: string,
modified-at: u64,
size: u64,
digest: string,
details: model-details
}
record list-response {
models: list<model-response>
}
chat: func(request: chat-request) -> result<chat-response, status-error>;
show: func(request: show-request) -> result<show-response, status-error>;
%list: func() -> result<list-response, status-error>;
}