Skip to content

Commit 8f615ad

Browse files
committed
feat: add togheterai
1 parent dbec550 commit 8f615ad

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ By the way if you to use not mandatory modules it is necessary to install by you
3636

3737
### Installing "Other Language Models"
3838

39-
This group allows you to use additional language models like Fireworks, Groq, Anthropic, Hugging Face, and Nvidia AI Endpoints.
39+
This group allows you to use additional language models like Fireworks, Groq, Anthropic, togheterai, Hugging Face, and Nvidia AI Endpoints.
4040
```bash
4141
pip install scrapegraphai[other-language-models]
4242

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ other-language-models = [
7777
"langchain-anthropic>=0.1.11",
7878
"langchain-huggingface>=0.0.3",
7979
"langchain-nvidia-ai-endpoints>=0.1.6",
80+
"together==1.2.9"
8081
]
8182

8283
# Group 2: More Semantic Options

scrapegraphai/graphs/abstract_graph.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,14 @@ def _create_llm(self, llm_config: dict) -> object:
157157
from langchain_community.chat_models import ErnieBotChat
158158
return ErnieBotChat(**llm_params)
159159

160-
if llm_params["model_provider"] == "oneapi":
160+
elif llm_params["model_provider"] == "oneapi":
161161
return OneApi(**llm_params)
162162

163-
if llm_params["model_provider"] == "nvidia":
163+
elif llm_params["model_provider"] == "togehterai":
164+
from langhcain_together import ChatTogether
165+
return ChatTogether(**llm_params)
166+
167+
elif llm_params["model_provider"] == "nvidia":
164168
try:
165169
from langchain_nvidia_ai_endpoints import ChatNVIDIA
166170
except ImportError:

scrapegraphai/helpers/models_tokens.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
"gemma-7b-it": 8192,
128128
"claude-3-haiku-20240307'": 8192,
129129
},
130+
"togheterai": {
131+
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 128000
132+
},
130133
"anthropic": {
131134
"claude_instant": 100000,
132135
"claude2": 9000,

0 commit comments

Comments
 (0)