Skip to content

Commit

Permalink
Add glhfChat provider
Browse files Browse the repository at this point in the history
  • Loading branch information
hlohaus committed Dec 28, 2024
1 parent ac087b1 commit 14c9305
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions g4f/Provider/needs_auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .Gemini import Gemini
from .GeminiPro import GeminiPro
from .GithubCopilot import GithubCopilot
from .glhfChat import glhfChat
from .Groq import Groq
from .HuggingChat import HuggingChat
from .HuggingFace import HuggingFace
Expand Down
29 changes: 29 additions & 0 deletions g4f/Provider/needs_auth/glhfChat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from __future__ import annotations

from .OpenaiAPI import OpenaiAPI

class glhfChat(OpenaiAPI):
label = "glhf.chat"
url = "https://glhf.chat"
api_base = "https://glhf.chat/api/openai/v1"
working = True
model_aliases = {
'Qwen2.5-Coder-32B-Instruct': 'hf:Qwen/Qwen2.5-Coder-32B-Instruct',
'Llama-3.1-405B-Instruct': 'hf:meta-llama/Llama-3.1-405B-Instruct',
'Llama-3.1-70B-Instruct': 'hf:meta-llama/Llama-3.1-70B-Instruct',
'Llama-3.1-8B-Instruct': 'hf:meta-llama/Llama-3.1-8B-Instruct',
'Llama-3.2-3B-Instruct': 'hf:meta-llama/Llama-3.2-3B-Instruct',
'Llama-3.2-11B-Vision-Instruct': 'hf:meta-llama/Llama-3.2-11B-Vision-Instruct',
'Llama-3.2-90B-Vision-Instruct': 'hf:meta-llama/Llama-3.2-90B-Vision-Instruct',
'Qwen2.5-72B-Instruct': 'hf:Qwen/Qwen2.5-72B-Instruct',
'Llama-3.3-70B-Instruct': 'hf:meta-llama/Llama-3.3-70B-Instruct',
'gemma-2-9b-it': 'hf:google/gemma-2-9b-it',
'gemma-2-27b-it': 'hf:google/gemma-2-27b-it',
'Mistral-7B-Instruct-v0.3': 'hf:mistralai/Mistral-7B-Instruct-v0.3',
'Mixtral-8x7B-Instruct-v0.1': 'hf:mistralai/Mixtral-8x7B-Instruct-v0.1',
'Mixtral-8x22B-Instruct-v0.1': 'hf:mistralai/Mixtral-8x22B-Instruct-v0.1',
'Nous-Hermes-2-Mixtral-8x7B-DPO': 'hf:NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO',
'Qwen2.5-7B-Instruct': 'hf:Qwen/Qwen2.5-7B-Instruct',
'SOLAR-10.7B-Instruct-v1.0': 'hf:upstage/SOLAR-10.7B-Instruct-v1.0',
'Llama-3.1-Nemotron-70B-Instruct-HF': 'hf:nvidia/Llama-3.1-Nemotron-70B-Instruct-HF'
}
4 changes: 4 additions & 0 deletions g4f/gui/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ <h3>Settings</h3>
<label for="Groq-api_key" class="label" title="">Groq:</label>
<textarea id="Groq-api_key" name="Groq[api_key]" placeholder="api_key"></textarea>
</div>
<div class="field box hidden">
<label for="glhfChat-api_key" class="label" title="">glhf.chat:</label>
<textarea id="glhfChat-api_key" name="glhfChat[api_key]" placeholder="api_key"></textarea>
</div>
<div class="field box hidden">
<label for="HuggingFace-api_key" class="label" title="">HuggingFace:</label>
<textarea id="HuggingFace-api_key" name="HuggingFace[api_key]" class="HuggingFaceAPI-api_key" placeholder="api_key"></textarea>
Expand Down

0 comments on commit 14c9305

Please sign in to comment.