Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for StepFun #1611

Merged
merged 23 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions conf/llm_factories.json
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,38 @@
"model_type": "chat"
}
]
},
{
"name": "StepFun",
"logo": "",
"tags": "LLM",
"status": "1",
"llm": [
{
"llm_name": "step-1-8k",
"tags": "LLM,CHAT,15k",
"max_tokens": 8192,
"model_type": "chat"
},
{
"llm_name": "step-1-32k",
"tags": "LLM,CHAT,32k",
"max_tokens": 32768,
"model_type": "chat"
},
{
"llm_name": "step-1-128k",
"tags": "LLM,CHAT,128k",
"max_tokens": 131072,
"model_type": "chat"
},
{
"llm_name": "step-1-256k",
"tags": "LLM,CHAT,256k",
"max_tokens": 262144,
"model_type": "chat"
}
]
}
]
}
1 change: 1 addition & 0 deletions rag/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"Bedrock": BedrockChat,
"Groq": GroqChat,
'OpenRouter':OpenRouterChat,
"StepFun":StepFunChat
}


Expand Down
6 changes: 6 additions & 0 deletions rag/llm/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,3 +897,9 @@ def __init__(self, key, model_name, base_url="https://openrouter.ai/api/v1"):
self.base_url = "https://openrouter.ai/api/v1"
self.client = OpenAI(base_url=self.base_url, api_key=key)
self.model_name = model_name

class StepFunChat(Base):
def __init__(self, key, model_name, base_url="https://api.stepfun.com/v1/chat/completions"):
if not base_url:
base_url = "https://api.stepfun.com/v1/chat/completions"
super().__init__(key, model_name, base_url)
Loading