forked from microsoft/generative-ai-with-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathollama.http
73 lines (62 loc) · 1.35 KB
/
ollama.http
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
##################################################################
# VS Code with REST Client extension is needed to use this file.
# Download at: https://aka.ms/vscode/rest-client
##################################################################
# Text completion
POST http://localhost:11434/api/generate
Content-Type: application/json
{
"prompt": "Translate in Japanese: Hello world",
"model": "phi3",
"options": {
"temperature": 0
},
"stream": false
}
###
# Chat completion
POST http://localhost:11434/api/chat
Content-Type: application/json
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Say hello in French, Japanese, and Spanish."
}
],
"model": "phi3",
"stream": false
}
###
# Embeddings
POST http://localhost:11434/api/embed
Content-Type: application/json
{
"input": [
"Why is the sky blue?",
"Hello world"
],
"model": "all-minilm:l6-v2"
}
###
# OpenAI API compatibility
POST http://localhost:11434/v1/chat/completions
Content-Type: application/json
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Say hello in French, Japanese, and Spanish."
}
],
"model": "phi3",
"response_format": { "type": "json_object" }
}