Skip to content

feat(fireworks): add document reranking - #39732

Merged
ccurme (ccurme) merged 6 commits into
langchain-ai:masterfrom
11adyy:feat/39340-fireworks-reranker
Aug 20, 2026
Merged

feat(fireworks): add document reranking#39732
ccurme (ccurme) merged 6 commits into
langchain-ai:masterfrom
11adyy:feat/39340-fireworks-reranker

Conversation

@11adyy

Copy link
Copy Markdown
Contributor

Fixes #39340

Add FireworksRerank to langchain-fireworks, allowing users to rerank LangChain documents with Fireworks reranking models through the standard BaseDocumentCompressor interface.

Release note

Add native Fireworks document reranking support.

Verification

  • make format, lint, test passed
  • Created unit test covering fireworks request payloads, document conversion, empty inputs and metadata preservation.

Social handles

LinkedIn: https://linkedin.com/in/11adyy

@github-actions github-actions Bot added feature For PRs that implement a new feature; NOT A FEATURE REQUEST fireworks `langchain-fireworks` package issues & PRs integration PR made that is related to a provider partner package integration size: M 200-499 LOC labels Aug 18, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/partners/fireworks/langchain_fireworks/rerank.py Outdated
…ial leakage


Prevent OpenAI credentials from being sent to Fireworks API when FIREWORKS_API_KEY is not configured.

When no client is injected and FIREWORKS_API_KEY is absent, the OpenAI SDK's fallback mechanism would use OPENAI_API_KEY as a fallback. This would cause the OpenAI credential to be sent as Authorization header to api.fireworks.ai, authenticating with the wrong provider.

Now explicitly require FIREWORKS_API_KEY when no client is supplied.

Fixes security issue identified in code review.

Co-authored-by: open-swe[bot] <215916821+open-swe[bot]@users.noreply.github.com>
Signed-off-by: Noah Dylan <111adyydev@gmail.com>

@ccurme ccurme (ccurme) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noah Dylan Pelegrini (@11adyy) this fails out of the box for me with

ValueError: not enough values to unpack (expected 2, got 0)

Did you run this yourself?

@ccurme
ccurme (ccurme) merged commit b8d1ab5 into langchain-ai:master Aug 20, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external feature For PRs that implement a new feature; NOT A FEATURE REQUEST fireworks `langchain-fireworks` package issues & PRs integration PR made that is related to a provider partner package integration new-contributor size: M 200-499 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fireworks reranker integration.

2 participants