Skip to content

Add free-LLM sentiment tier above FinBERT/VADER#1

Open
beepboop2025 wants to merge 1 commit into
mainfrom
feat/free-llm-router
Open

Add free-LLM sentiment tier above FinBERT/VADER#1
beepboop2025 wants to merge 1 commit into
mainfrom
feat/free-llm-router

Conversation

@beepboop2025

Copy link
Copy Markdown
Owner

What

Adds an optional LLM sentiment tier on top of the existing FinBERT → XLM-RoBERTa → VADER chain, powered by a vendored free_llm_router (perpetually-free providers).

Why

Keyword/FinBERT scoring conflates tone with market direction — e.g. "rate hike" reads positive in tone but is bearish for equities. The LLM returns explicit direction (bullish/bearish/neutral) alongside the score.

Behavior

  • LLM sits above the existing chain; on any failure (all free providers down, unparseable output) it falls through to FinBERT → VADER. Existing reliability fully preserved.
  • Sync asyncio.run bridge (Celery workers have no running event loop).
  • Enabled by default when the package is present; FREE_LLM_ENABLED=false disables it.
  • Router uses only providers whose key is set.

Verified

Compiles clean; router internals smoke-tested. Not yet exercised with live keys.

🤖 Generated with Claude Code

Vendor free_llm_router and layer an LLM sentiment tier on top of the existing
FinBERT -> XLM-RoBERTa -> VADER chain in processors/sentiment.py. The LLM returns
financial sentiment with direction (bullish/bearish), which keyword/FinBERT
scoring conflates with tone. Falls through to the existing chain on any failure,
so reliability is unchanged.

- Sync asyncio.run bridge (Celery workers have no running loop).
- Enabled by default when the package is present; FREE_LLM_ENABLED=false to disable.
- .env.example documents per-provider keys.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant