Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
ed52833b
Unverified
Commit
ed52833b
authored
Aug 01, 2024
by
royjhan
Committed by
GitHub
Aug 01, 2024
Browse files
Add to docs (#5309)
parent
6f133a0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
docs/openai.md
docs/openai.md
+13
-0
No files found.
docs/openai.md
View file @
ed52833b
...
@@ -29,6 +29,8 @@ chat_completion = client.chat.completions.create(
...
@@ -29,6 +29,8 @@ chat_completion = client.chat.completions.create(
)
)
list_completion
=
client
.
models
.
list
()
list_completion
=
client
.
models
.
list
()
model
=
client
.
models
.
retrieve
(
"llama3"
)
```
```
### OpenAI JavaScript library
### OpenAI JavaScript library
...
@@ -49,6 +51,8 @@ const chatCompletion = await openai.chat.completions.create({
...
@@ -49,6 +51,8 @@ const chatCompletion = await openai.chat.completions.create({
})
})
const
listCompletion
=
await
openai
.
models
.
list
()
const
listCompletion
=
await
openai
.
models
.
list
()
const
model
=
await
openai
.
models
.
retrieve
(
"
llama3
"
);
```
```
### `curl`
### `curl`
...
@@ -71,6 +75,8 @@ curl http://localhost:11434/v1/chat/completions \
...
@@ -71,6 +75,8 @@ curl http://localhost:11434/v1/chat/completions \
}'
}'
curl http://localhost:11434/v1/models
curl http://localhost:11434/v1/models
curl https://api.openai.com/v1/models/llama3
```
```
## Endpoints
## Endpoints
...
@@ -115,6 +121,13 @@ curl http://localhost:11434/v1/models
...
@@ -115,6 +121,13 @@ curl http://localhost:11434/v1/models
-
`created`
corresponds to when the model was last modified
-
`created`
corresponds to when the model was last modified
-
`owned_by`
corresponds to the ollama username, defaulting to
`"library"`
-
`owned_by`
corresponds to the ollama username, defaulting to
`"library"`
### `/v1/models/{model}`
#### Notes
-
`created`
corresponds to when the model was last modified
-
`owned_by`
corresponds to the ollama username, defaulting to
`"library"`
## Models
## Models
Before using a model, pull it locally
`ollama pull`
:
Before using a model, pull it locally
`ollama pull`
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment