FinSightAI / backend /scripts /test_llm.py
Aniket2003333333's picture
start
7248d39
Raw
History Blame Contribute Delete
675 Bytes
"""Smoke test for Modal-backed LLM."""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from models.llm import MiniCPMLLM
def main():
print("Calling Modal LLM (first call may take ~1 min for cold start)...")
llm = MiniCPMLLM()
tokens = list(
llm.stream_answer(
"What is EBITDA?",
"EBITDA stands for Earnings Before Interest, Taxes, Depreciation, and Amortization.",
)
)
answer = "".join(tokens)
print(f"Answer: {answer[:200]}...")
assert len(answer) > 0, "LLM returned empty response"
print("Modal LLM test passed.")
if __name__ == "__main__":
main()