Skip to content

Commit 709b334

Browse files
committed
Add mistral medium
1 parent 31e4eee commit 709b334

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
## Supported LLM's
1717

18-
- GPT-3.5-turbo-16k
19-
- Claude-instant-v1
20-
- Mixtral 8x7B
18+
- GPT-3.5-turbo-0125
19+
- CodeLlama-70B
20+
- Mistral Medium
2121

2222
#
2323

chain.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ModelConfig(BaseModel):
3434

3535
@validator("model_type", pre=True, always=True)
3636
def validate_model_type(cls, v):
37-
if v not in ["gpt", "codellama", "mixtral"]:
37+
if v not in ["gpt", "codellama", "mistral"]:
3838
raise ValueError(f"Unsupported model type: {v}")
3939
return v
4040

@@ -55,7 +55,7 @@ def setup(self):
5555
self.setup_gpt()
5656
elif self.model_type == "codellama":
5757
self.setup_codellama()
58-
elif self.model_type == "mixtral":
58+
elif self.model_type == "mistral":
5959
self.setup_mixtral()
6060

6161
def setup_gpt(self):
@@ -71,13 +71,13 @@ def setup_gpt(self):
7171

7272
def setup_mixtral(self):
7373
self.llm = ChatOpenAI(
74-
model_name="mistralai/Mixtral-8x7B-Instruct-v0.1",
74+
model_name="mistralai/mistral-medium",
7575
temperature=0.2,
76-
api_key=self.secrets["MIXTRAL_API_KEY"],
76+
api_key=self.secrets["OPENROUTER_API_KEY"],
7777
max_tokens=500,
7878
callbacks=[self.callback_handler],
7979
streaming=True,
80-
base_url="https://api.together.xyz/v1",
80+
base_url="https://openrouter.ai/api/v1",
8181
)
8282

8383
def setup_codellama(self):
@@ -157,8 +157,8 @@ def load_chain(model_name="GPT-3.5", callback_handler=None):
157157
model_type = "codellama"
158158
elif "GPT-3.5" in model_name:
159159
model_type = "gpt"
160-
elif "mixtral" in model_name.lower():
161-
model_type = "mixtral"
160+
elif "mistral" in model_name.lower():
161+
model_type = "mistral"
162162
else:
163163
raise ValueError(f"Unsupported model name: {model_name}")
164164

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
st.caption("Talk your way through data")
1919
model = st.radio(
2020
"",
21-
options=["✨ GPT-3.5", "♾️ codellama", "⛰️ Mixtral"],
21+
options=["✨ GPT-3.5", "♾️ codellama", "👑 Mistral"],
2222
index=0,
2323
horizontal=True,
2424
)

0 commit comments

Comments
 (0)