Llama Inference Api
llamainferenceAIvllmmachine-learningapi_inferencellama2LLMllama-cookbookPythonfinetuningpytorchlangchaingetting-started
Export
Llama LLM API Client Notebook
This Notebook will send a request to the Llama LLM model's API and retrieve the response.
First we will import os, gradio and the LlamaAPIClient
[1]
Use the following link to retrieve your Llama API key. Next, configure your environment by setting the "LLAMA_API_KEY" variable to the obtained key using one of the following steps.
[25]
Run the "infer" function to create an interactive UI where you can enter your input prompt for the LLM in the designated "user_input" field and view the generated response in the adjacent "output" field.
[53]
* Running on local URL: http://127.0.0.1:7890 * To create a public link, set `share=True` in `launch()`.
The model can be used on a range of use cases, including factoid-based question answering, to demonstrate its effectiveness and versatility in real-world scenarios.
[52]
* Running on local URL: http://127.0.0.1:7889 * To create a public link, set `share=True` in `launch()`.
[54]
* Running on local URL: http://127.0.0.1:7891 * To create a public link, set `share=True` in `launch()`.
[ ]