Requesting Available Models
Introduction
Users can send GET requests to the /layar/gpt/models
endpoint in order to get a list of the available models. This can be used in tandem with the models
parameter to direct prompts to specific models.
Pre-Reqs
Before a document search can be done the API requests must be authenticated. Make sure you have already followed the instructions for importing dependencies and authentication from the Getting Started Guide.
Check Your Imported Modules
Make sure you have imported the
requests
andjson
module before proceeding with this guide.
The following header can be used in your request.
header = {'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': f"Bearer {token}",
'X-Vyasa-Client': 'layar',
'X-Vyasa-Data-Providers' : 'sandbox.certara.ai',
'X-Vyasa-Data-Fabric' : 'YOUR_FABRIC_ID'
}
GET Request
No body is needed when doing a GET, the following code can be used to get a list of available models.
getModelUrl = 'https://YOUR_ENVIRONMENT/Layar/gpt/models
response = requests.post(getModelUrl,
headers = header) '
Response
The request will give a response containing a list of all the models available on the environment.
[
'Mistral-7B-Instruct-v0.1',
'mixtral-instruct-awq',
'llama-3-70b-instruct-awq'
]
Updated about 1 month ago