Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update API Reference model_id from DevDocs #2169

Merged
merged 3 commits into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 76 additions & 4 deletions docs/openapi/jan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 204,47 @@ paths:
$ref: specs/models.yaml#/components/schemas/GetModelResponse
x-codeSamples:
- lang: cURL
source: |
curl -X 'GET' \
'http://localhost:1337/v1/models/{model_id}' \
source: |-
curl -X 'GET' \
'http://localhost:1337/v1/models/{model_id}' \
-H 'accept: application/json'
- lang: JavaScript
source: |-
const fetch = require('node-fetch');

const modelId = 'mistral-ins-7b-q4';

fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'GET',
headers: {'accept': 'application/json'}
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Node.js
source: |-
const fetch = require('node-fetch');

const modelId = 'mistral-ins-7b-q4';

fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'GET',
headers: {'accept': 'application/json'}
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Python
source: >-
import requests


model_id = 'mistral-ins-7b-q4'


response =
requests.get(f'http://localhost:1337/v1/models/{model_id}',
headers={'accept': 'application/json'})

print(response.json())
delete:
operationId: deleteModel
tags:
Expand Down Expand Up @@ -235,10 272,45 @@ paths:
$ref: specs/models.yaml#/components/schemas/DeleteModelResponse
x-codeSamples:
- lang: cURL
source: |
source: |-
curl -X 'DELETE' \
'http://localhost:1337/v1/models/{model_id}' \
-H 'accept: application/json'
- lang: JavaScript
source: |-
const fetch = require('node-fetch');

const modelId = 'mistral-ins-7b-q4';

fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'DELETE',
headers: { 'accept': 'application/json' }
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Node.js
source: |-
const fetch = require('node-fetch');

const modelId = 'mistral-ins-7b-q4';

fetch(`http://localhost:1337/v1/models/${modelId}`, {
method: 'DELETE',
headers: { 'accept': 'application/json' }
})
.then(res => res.json())
.then(json => console.log(json));
- lang: Python
source: >-
import requests


model_id = 'mistral-ins-7b-q4'


response =
requests.delete(f'http://localhost:1337/v1/models/{model_id}',
headers={'accept': 'application/json'})
/threads:
post:
operationId: createThread
Expand Down
Loading