File size: 1,241 Bytes
4bb745d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from llama_index.llms.huggingface import HuggingFaceLLM, HuggingFaceInferenceAPI
from llama_index.llms.openai import OpenAI
from llama_index.llms.replicate import Replicate
from dotenv import load_dotenv
import os

load_dotenv()

llm_mixtral_8x7b = HuggingFaceInferenceAPI(
    model_name="mistralai/Mixtral-8x7B-Instruct-v0.1",
    token=os.getenv("HUGGINGFACE_API_TOKEN"),
)

# download the model from the Hugging Face Hub and run it locally
# llm_mixtral_8x7b = HuggingFaceLLM(model_name="mistralai/Mixtral-8x7B-Instruct-v0.1")

llm_llama_2_7b_chat = HuggingFaceInferenceAPI(
    model_name="meta-llama/Llama-2-7b-chat-hf",
    token=os.getenv("HUGGINGFACE_API_TOKEN"),
)

llm_bloomz_560m = HuggingFaceInferenceAPI(
    model_name="bigscience/bloomz-560m",
    token=os.getenv("HUGGINGFACE_API_TOKEN"),
)

llm_gpt_3_5_turbo = OpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
)

llm_gpt_3_5_turbo_0125 = OpenAI(
    model="gpt-3.5-turbo-0125",
    api_key="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",
)

llm_gpt_4_0125 = OpenAI(
    model="gpt-4-0125-preview",
    api_key=os.getenv("OPENAI_API_KEY"),
)

llm_llama_13b_v2_replicate = Replicate(
    model="meta/llama-2-13b-chat",
    prompt_key=os.getenv("REPLICATE_API_KEY"),
)