Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ client = OpenAI(
|
|
| 19 |
api_key=YOUR__API_KEY,
|
| 20 |
)
|
| 21 |
|
| 22 |
-
models = [
|
| 23 |
"google/gemini-2.5-flash-lite",
|
| 24 |
"google/gemini-2.0-flash-lite-001",
|
| 25 |
"google/gemma-3-27b-it",
|
|
@@ -129,12 +129,14 @@ def assess_text_harmfulness(input_text, fallback_models):
|
|
| 129 |
}
|
| 130 |
return json.dumps(json_data, indent=4), format_json_output(json_data)
|
| 131 |
|
| 132 |
-
models_to_try = fallback_models
|
|
|
|
| 133 |
|
| 134 |
-
for
|
| 135 |
try:
|
|
|
|
| 136 |
resp = client.chat.completions.create(
|
| 137 |
-
model=
|
| 138 |
messages=[
|
| 139 |
{
|
| 140 |
"role": "user",
|
|
@@ -395,14 +397,14 @@ theme = gr.themes.Glass(
|
|
| 395 |
|
| 396 |
with gr.Blocks(theme=theme, css=light_blue_glass_css, title="Falconz Unified App") as demo:
|
| 397 |
|
| 398 |
-
|
| 399 |
gr.Markdown(""" # 🔐 Falconz - RedTeamers
|
| 400 |
|
| 401 |
### 🛡️ Unified AI Security for Multi-Model & Agentic Systems
|
| 402 |
-
Falconz is an MCP-powered Gradio platform that safeguards LLM and agentic applications through real-time jailbreak and prompt-injection detection across OpenAI, Gemini, Mistral, Phi, and more.
|
| 403 |
-
It includes an inbuilt library of the latest Top 10 jailbreak templates (Inspired by O.S.W.A.P) that users can customize, modify, and deploy for controlled testing and red-teaming workflows.
|
| 404 |
-
Falconz supports both prompt template modification and threat detection—letting users experiment safely while continuously monitoring model behavior.
|
| 405 |
-
A lightweight safeguard model provides fast, on-device-friendly risk screening for quick evaluation cycles.
|
| 406 |
Plug-and-play with MCP to secure your AI stack and access live analytics in a single, streamlined interface.
|
| 407 |
""")
|
| 408 |
|
|
@@ -412,7 +414,7 @@ with gr.Blocks(theme=theme, css=light_blue_glass_css, title="Falconz Unified App
|
|
| 412 |
with gr.Row():
|
| 413 |
with gr.Column(scale=50):
|
| 414 |
model_select = gr.Radio(choices=models, value=models[0], label="Select Model ")
|
| 415 |
-
|
| 416 |
chatbot = gr.Chatbot(label="Chat History", height=300, type='messages')
|
| 417 |
user_input = gr.Textbox(label="Your Message", placeholder="Type your message here...", lines=5)
|
| 418 |
|
|
|
|
| 19 |
api_key=YOUR__API_KEY,
|
| 20 |
)
|
| 21 |
|
| 22 |
+
models = ["anthropic/claude-sonnet-4.5",
|
| 23 |
"google/gemini-2.5-flash-lite",
|
| 24 |
"google/gemini-2.0-flash-lite-001",
|
| 25 |
"google/gemma-3-27b-it",
|
|
|
|
| 129 |
}
|
| 130 |
return json.dumps(json_data, indent=4), format_json_output(json_data)
|
| 131 |
|
| 132 |
+
# models_to_try = fallback_models
|
| 133 |
+
models_to_try = ["anthropic/claude-sonnet-4.5", "anthropic/claude-sonnet-4", "anthropic/claude-haiku-4.5", "anthropic/claude-opus-4.5", "anthropic/claude-3.5-haiku"]
|
| 134 |
|
| 135 |
+
for Detective_model in models_to_try:
|
| 136 |
try:
|
| 137 |
+
print(f"model used as detective is {Detective_model}")
|
| 138 |
resp = client.chat.completions.create(
|
| 139 |
+
model=Detective_model,
|
| 140 |
messages=[
|
| 141 |
{
|
| 142 |
"role": "user",
|
|
|
|
| 397 |
|
| 398 |
with gr.Blocks(theme=theme, css=light_blue_glass_css, title="Falconz Unified App") as demo:
|
| 399 |
|
| 400 |
+
|
| 401 |
gr.Markdown(""" # 🔐 Falconz - RedTeamers
|
| 402 |
|
| 403 |
### 🛡️ Unified AI Security for Multi-Model & Agentic Systems
|
| 404 |
+
Falconz is an MCP-powered Gradio platform that safeguards LLM and agentic applications through real-time jailbreak and prompt-injection detection across OpenAI, Gemini, Mistral, Phi, and more.
|
| 405 |
+
It includes an inbuilt library of the latest Top 10 jailbreak templates (Inspired by O.S.W.A.P) that users can customize, modify, and deploy for controlled testing and red-teaming workflows.
|
| 406 |
+
Falconz supports both prompt template modification and threat detection—letting users experiment safely while continuously monitoring model behavior.
|
| 407 |
+
A lightweight safeguard model provides fast, on-device-friendly risk screening for quick evaluation cycles.
|
| 408 |
Plug-and-play with MCP to secure your AI stack and access live analytics in a single, streamlined interface.
|
| 409 |
""")
|
| 410 |
|
|
|
|
| 414 |
with gr.Row():
|
| 415 |
with gr.Column(scale=50):
|
| 416 |
model_select = gr.Radio(choices=models, value=models[0], label="Select Model ")
|
| 417 |
+
|
| 418 |
chatbot = gr.Chatbot(label="Chat History", height=300, type='messages')
|
| 419 |
user_input = gr.Textbox(label="Your Message", placeholder="Type your message here...", lines=5)
|
| 420 |
|