四盘
commited on
Commit
·
16fb478
1
Parent(s):
225aa4f
add ling-flash
Browse files- .idea/.gitignore +8 -0
- app.py +20 -1
.idea/.gitignore
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
| 4 |
+
# Editor-based HTTP Client requests
|
| 5 |
+
/httpRequests/
|
| 6 |
+
# Datasource local storage ignored files
|
| 7 |
+
/dataSources/
|
| 8 |
+
/dataSources.local.xml
|
app.py
CHANGED
|
@@ -1703,6 +1703,11 @@ CRITICAL: For imported spaces that lack anycoder attribution, you MUST add it as
|
|
| 1703 |
|
| 1704 |
# Available models
|
| 1705 |
AVAILABLE_MODELS = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1706 |
{
|
| 1707 |
"name": "Grok 4 Fast (Free)",
|
| 1708 |
"id": "x-ai/grok-4-fast:free",
|
|
@@ -2126,6 +2131,20 @@ def get_inference_client(model_id, provider="auto"):
|
|
| 2126 |
if not base_url:
|
| 2127 |
raise ValueError("STEALTH_MODEL_1_BASE_URL environment variable is required for Carrot model")
|
| 2128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2129 |
return OpenAI(
|
| 2130 |
api_key=api_key,
|
| 2131 |
base_url=base_url,
|
|
@@ -10101,4 +10120,4 @@ if __name__ == "__main__":
|
|
| 10101 |
show_api=False,
|
| 10102 |
ssr_mode=True,
|
| 10103 |
mcp_server=False
|
| 10104 |
-
)
|
|
|
|
| 1703 |
|
| 1704 |
# Available models
|
| 1705 |
AVAILABLE_MODELS = [
|
| 1706 |
+
{
|
| 1707 |
+
"name": "SiliconFlow -> inclusionAI/Ling-flash-2.0",
|
| 1708 |
+
"id": "siliconflow/inclusionai-ling-flash-2.0",
|
| 1709 |
+
"description": "InclusionAI Ling-flash-2.0 model for code generation and general tasks"
|
| 1710 |
+
},
|
| 1711 |
{
|
| 1712 |
"name": "Grok 4 Fast (Free)",
|
| 1713 |
"id": "x-ai/grok-4-fast:free",
|
|
|
|
| 2131 |
if not base_url:
|
| 2132 |
raise ValueError("STEALTH_MODEL_1_BASE_URL environment variable is required for Carrot model")
|
| 2133 |
|
| 2134 |
+
return OpenAI(
|
| 2135 |
+
api_key=api_key,
|
| 2136 |
+
base_url=base_url,
|
| 2137 |
+
)
|
| 2138 |
+
elif model_id == "siliconflow/inclusionai-ling-flash-2.0":
|
| 2139 |
+
# Use SiliconFlow (OpenAI-compatible) client for inclusionAI/Ling-flash-2.0 model
|
| 2140 |
+
api_key = os.getenv("SILICONFLOW_API_KEY")
|
| 2141 |
+
if not api_key:
|
| 2142 |
+
raise ValueError("SILICONFLOW_API_KEY environment variable is required for SiliconFlow models")
|
| 2143 |
+
|
| 2144 |
+
base_url = os.getenv("SILICONFLOW_BASE_URL")
|
| 2145 |
+
if not base_url:
|
| 2146 |
+
raise ValueError("SILICONFLOW_BASE_URL environment variable is required for SiliconFlow models")
|
| 2147 |
+
|
| 2148 |
return OpenAI(
|
| 2149 |
api_key=api_key,
|
| 2150 |
base_url=base_url,
|
|
|
|
| 10120 |
show_api=False,
|
| 10121 |
ssr_mode=True,
|
| 10122 |
mcp_server=False
|
| 10123 |
+
)
|