Spaces:
Sleeping
Sleeping
app: | |
name: ${APP_NAME:LLM Guard API} | |
log_level: ${LOG_LEVEL:INFO} | |
scan_fail_fast: ${SCAN_FAIL_FAST:false} | |
scan_prompt_timeout: ${SCAN_PROMPT_TIMEOUT:10} | |
scan_output_timeout: ${SCAN_OUTPUT_TIMEOUT:30} | |
port: ${APP_PORT:7860} | |
cache: | |
ttl: ${CACHE_TTL:3600} | |
#max_size: ${CACHE_MAX_SIZE:1000} | |
rate_limit: | |
enabled: ${RATE_LIMIT_ENABLED:true} | |
limit: ${RATE_LIMIT_LIMIT:100/minute} | |
#auth: | |
# type: http_bearer | |
# token: ${AUTH_TOKEN:} | |
tracing: | |
exporter: ${TRACING_EXPORTER:console} | |
endpoint: ${TRACING_OTEL_ENDPOINT:} # Example: "<traces-endpoint>/v1/traces" | |
metrics: | |
exporter: ${METRICS_TYPE:prometheus} | |
endpoint: ${METRICS_ENDPOINT:} # Example: "<metrics-endpoint>/v1/metrics" | |
# Scanners are applied in the order they are listed here. | |
input_scanners: | |
# - type: Anonymize | |
# params: | |
# # allowed_names: [] | |
# # hidden_names: [] | |
# # entity_types: [] | |
# # preamble: "" | |
# use_faker: false | |
# - type: BanCompetitors | |
# params: | |
# competitors: ["facebook"] | |
# threshold: 0.5 | |
# - type: BanSubstrings | |
# params: | |
# substrings: ["test"] | |
# match_type: "word" | |
# case_sensitive: false | |
# redact: false | |
# contains_all: false | |
# - type: BanTopics | |
# params: | |
# topics: ["violence"] | |
# threshold: 0.6 | |
# - type: Code | |
# params: | |
# languages: ["Python"] | |
# is_blocked: true | |
# - type: Gibberish | |
# params: | |
# threshold: 0.9 | |
# - type: InvisibleText | |
# params: {} | |
# - type: Language | |
# params: | |
# valid_languages: ["en"] | |
- type: PromptInjection | |
params: | |
threshold: 0.9 | |
# - type: Regex | |
# params: | |
# patterns: ["Bearer [A-Za-z0-9-._~+/]+"] | |
# is_blocked: true | |
# match_type: search | |
# redact: true | |
# - type: Secrets | |
# params: | |
# redact_mode: "all" | |
# - type: Sentiment | |
# params: | |
# # lexicon: "vader_lexicon" | |
# threshold: -0.1 | |
# - type: TokenLimit | |
# params: | |
# limit: 4096 | |
# encoding_name: "cl100k_base" | |
- type: Toxicity | |
params: | |
threshold: 0.5 | |
output_scanners: | |
# - type: BanCompetitors | |
# params: | |
# competitors: ["facebook"] | |
# threshold: 0.5 | |
# - type: BanSubstrings | |
# params: | |
# substrings: ["test"] | |
# match_type: "word" | |
# case_sensitive: false | |
# redact: false | |
# contains_all: false | |
# - type: BanTopics | |
# params: | |
# topics: ["violence"] | |
# threshold: 0.6 | |
# - type: Bias | |
# params: | |
# threshold: 0.75 | |
# - type: Code | |
# params: | |
# languages: ["Python"] | |
# is_blocked: true | |
# - type: Deanonymize | |
# params: | |
# matching_strategy: "exact" | |
# - type: FactualConsistency | |
# params: | |
# minimum_score: 0.5 | |
# - type: Gibberish | |
# params: | |
# threshold: 0.9 | |
# - type: JSON | |
# params: | |
# required_elements: 0 | |
# repair: true | |
# - type: Language | |
# params: | |
# valid_languages: ["en"] | |
# - type: LanguageSame | |
# params: {} | |
# - type: MaliciousURLs | |
# params: | |
# threshold: 0.75 | |
- type: NoRefusal | |
params: | |
threshold: 0.5 | |
# - type: ReadingTime | |
# params: | |
# max_time: 5 | |
# truncate: false | |
# - type: Regex | |
# params: | |
# patterns: ["Bearer [A-Za-z0-9-._~+/]+"] | |
# is_blocked: true | |
# match_type: search | |
# redact: true | |
- type: Relevance | |
params: | |
threshold: 0.5 | |
- type: Sensitive | |
params: | |
# entity_types: | |
redact: false | |
threshold: 0.0 | |
# - type: Sentiment | |
# params: | |
# threshold: -0.1 | |
# # lexicon: "vader_lexicon" | |
# - type: Toxicity | |
# params: | |
# threshold: 0.5 | |
# - type: URLReachability | |
# params: {} | |