Spaces:
Sleeping

File size: 4,505 Bytes
3e964dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# =============================================================================
# FINORA BACKEND β€” Environment Variables Template
# Copy this file to .env and fill in your values:  cp .env.example .env
# Production: set all these in HuggingFace Secrets instead of this file
# =============================================================================

# ── LLM: Groq ────────────────────────────────────────────────────────────────
# https://console.groq.com β†’ Create API Key
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL_PRIMARY=llama-3.3-70b-versatile
GROQ_MODEL_FAST=llama-3.1-8b-instant
GROQ_MAX_TOKENS=2048
GROQ_TEMPERATURE=0.1

# ── Observability: LangSmith ──────────────────────────────────────────────────
# https://smith.langchain.com β†’ Settings β†’ API Keys
LANGCHAIN_API_KEY=your_langsmith_api_key_here
LANGCHAIN_PROJECT=finora-prod
LANGCHAIN_TRACING_V2=true
LANGCHAIN_ENDPOINT=https://api.smith.langchain.com

# ── Vector Store: Qdrant Cloud ────────────────────────────────────────────────
# https://cloud.qdrant.io β†’ Create free cluster β†’ copy URL and API key
QDRANT_URL=https://your-cluster-id.us-east-1-1.aws.cloud.qdrant.io
QDRANT_API_KEY=your_qdrant_api_key_here
QDRANT_COLLECTION_NEWS=finora_news
QDRANT_COLLECTION_HISTORICAL=finora_historical
QDRANT_COLLECTION_FILINGS=finora_filings

# ── Reranker: Cohere ──────────────────────────────────────────────────────────
# https://dashboard.cohere.com β†’ API Keys (free tier available)
# Falls back to local BAAI/bge-reranker-base if Cohere fails or rate-limits
COHERE_API_KEY=your_cohere_api_key_here
RERANKER_PROVIDER=cohere

# ── Market Data ───────────────────────────────────────────────────────────────
# Polygon.io: https://polygon.io/dashboard (free: 5 calls/min)
POLYGON_API_KEY=your_polygon_api_key_here
# NewsAPI: https://newsapi.org/register (free: 100 req/day)
NEWSAPI_KEY=your_newsapi_key_here

# ── Embeddings: HuggingFace (local, no API key needed) ───────────────────────
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
RERANKER_MODEL=BAAI/bge-reranker-base
HF_HOME=./data/hf_cache

# ── SEC EDGAR (no key β€” fair use requires a user agent) ──────────────────────
SEC_EDGAR_USER_AGENT=YourName contact@youremail.com

# ── RAG Configuration ─────────────────────────────────────────────────────────
RAG_TOP_K=8
RAG_OVER_RETRIEVE_FACTOR=2
RAG_HYDE_ENABLED=true
RAG_RERANKER_ENABLED=true
RAG_HYBRID_ALPHA=0.6
RAG_MMR_LAMBDA=0.6
RAG_DEDUP_THRESHOLD=0.92

# ── Guardrails ────────────────────────────────────────────────────────────────
GUARDRAILS_ENABLED=true
GUARDRAILS_MODE=strict
DISCLAIMER_LOCALE=IN
GUARDRAILS_LOG_BLOCKED=true

# ── Application ───────────────────────────────────────────────────────────────
BACKEND_PORT=7860
BACKEND_HOST=0.0.0.0
ENV=development
LOG_LEVEL=INFO
CORS_ORIGINS=http://localhost:3000,https://your-app.vercel.app
SCHEDULER_ENABLED=false

# ── Rate Limiting ─────────────────────────────────────────────────────────────
RATE_LIMIT_PER_MINUTE=20
RATE_LIMIT_PER_HOUR=200
MAX_QUERY_LENGTH=500
MAX_CONVERSATION_TURNS=50

# ── Ingestion Scheduler ───────────────────────────────────────────────────────
NEWS_INGEST_INTERVAL_MINUTES=15
HISTORICAL_UPDATE_INTERVAL_HOURS=24