akhaliq HF Staff commited on
Commit
8971824
·
1 Parent(s): d979272

add grok code fast

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +11 -0
README.md CHANGED
@@ -46,7 +46,7 @@ pip install -r requirements.txt
46
  export HF_TOKEN="your_huggingface_token"
47
  export TAVILY_API_KEY="your_tavily_api_key" # Optional, for web search feature
48
  export DASHSCOPE_API_KEY="your_dashscope_api_key" # Required for Qwen3-30B models via DashScope
49
- export POE_API_KEY="your_poe_api_key" # Required for GPT-5 and Grok-4 via Poe
50
  export GEMINI_API_KEY="your_gemini_api_key" # Required for Gemini models
51
  export MOONSHOT_API_KEY="your_moonshot_api_key" # Required for Kimi models
52
  ```
 
46
  export HF_TOKEN="your_huggingface_token"
47
  export TAVILY_API_KEY="your_tavily_api_key" # Optional, for web search feature
48
  export DASHSCOPE_API_KEY="your_dashscope_api_key" # Required for Qwen3-30B models via DashScope
49
+ export POE_API_KEY="your_poe_api_key" # Required for GPT-5, Grok-4, and Grok-Code-Fast-1 via Poe
50
  export GEMINI_API_KEY="your_gemini_api_key" # Required for Gemini models
51
  export MOONSHOT_API_KEY="your_moonshot_api_key" # Required for Kimi models
52
  ```
app.py CHANGED
@@ -876,6 +876,11 @@ AVAILABLE_MODELS = [
876
  "id": "grok-4",
877
  "description": "Grok-4 model via Poe (OpenAI-compatible) for advanced tasks"
878
  },
 
 
 
 
 
879
  {
880
  "name": "Claude-Opus-4.1",
881
  "id": "claude-opus-4.1",
@@ -992,6 +997,12 @@ def get_inference_client(model_id, provider="auto"):
992
  api_key=os.getenv("POE_API_KEY"),
993
  base_url="https://api.poe.com/v1"
994
  )
 
 
 
 
 
 
995
  elif model_id == "claude-opus-4.1":
996
  # Use Poe (OpenAI-compatible) client for Claude-Opus-4.1
997
  return OpenAI(
 
876
  "id": "grok-4",
877
  "description": "Grok-4 model via Poe (OpenAI-compatible) for advanced tasks"
878
  },
879
+ {
880
+ "name": "Grok-Code-Fast-1",
881
+ "id": "Grok-Code-Fast-1",
882
+ "description": "Grok-Code-Fast-1 model via Poe (OpenAI-compatible) for fast code generation"
883
+ },
884
  {
885
  "name": "Claude-Opus-4.1",
886
  "id": "claude-opus-4.1",
 
997
  api_key=os.getenv("POE_API_KEY"),
998
  base_url="https://api.poe.com/v1"
999
  )
1000
+ elif model_id == "Grok-Code-Fast-1":
1001
+ # Use Poe (OpenAI-compatible) client for Grok-Code-Fast-1 model
1002
+ return OpenAI(
1003
+ api_key=os.getenv("POE_API_KEY"),
1004
+ base_url="https://api.poe.com/v1"
1005
+ )
1006
  elif model_id == "claude-opus-4.1":
1007
  # Use Poe (OpenAI-compatible) client for Claude-Opus-4.1
1008
  return OpenAI(