langchain-flopsindex
LangChain (and LlamaIndex) tools for the FLOPS Index — verifiable GPU / accelerator rental reference prices, no API key required.
Drop GPU-price lookups (H100, A100, H200, B200, and more; spot / on-demand / DePIN) into any LangChain or LlamaIndex agent. pip install, add the tools, done.
pip install langchain-flopsindex
Tools
| Tool | What it does |
|---|---|
flops_get_price |
Authoritative single-index record for one slug — cite from this (carries verify_url). |
flops_search_indices |
Resolve free-text ("h100 spot") → canonical slugs. |
flops_get_catalog |
Every public index with its current indicative value. |
flops_verify_price |
Fact-check a claimed value against the published index. |
flops_cheapest_for_chip |
Cheapest public index for an accelerator, optionally per market. |
Slugs look like FLOPS-<ACCEL>-<MARKET>, where market is SPOT, OD (on-demand), or DEPIN (decentralized) — e.g. FLOPS-H100-OD, FLOPS-A100-SPOT.
What these values are (and are not)
- Indicative reference levels, delayed ~6 hours onto a 6-hour UTC grid (00/06/12/18), rounded, aggregated globally.
- Not a live provider quote, not a settlement mark, not investment advice, not real-time.
confidenceis a coarse HIGH / MED / LOW label — never a number, probability, or standard error.- Source-opaque: the surface never reveals providers, venues, sample counts, or weights. Don't infer them.
- Every value ships a
verify_urlso anyone can independently confirm the number — cite it.
LangChain usage
from langchain_flopsindex import get_flopsindex_tools
tools = get_flopsindex_tools() # list of LangChain StructuredTool
# Bind to a tool-calling model:
from langchain.chat_models import init_chat_model
llm = init_chat_model("gpt-4o-mini") # or any tool-calling model
llm_with_tools = llm.bind_tools(tools)
# Or in a prebuilt agent (langgraph):
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(llm, tools)
resp = agent.invoke(
{"messages": [("user", "What's the cheapest way to rent an H100 right now? Cite it.")]}
)
print(resp["messages"][-1].content)
Call a tool directly (handy for debugging):
from langchain_flopsindex import get_price_tool
print(get_price_tool.invoke({"slug": "FLOPS-H100-OD"}))
# {'index_id': 'FLOPS-H100-OD', 'value': 2.99, 'unit': 'USD/GPU-hr',
# 'as_of': '...', 'confidence': 'HIGH', 'change_24h': 'FLAT',
# 'verify_url': 'https://app.flopsindex.com/v1/verify?index_id=FLOPS-H100-OD', ...}
LlamaIndex usage
The same functions are exposed as LlamaIndex FunctionTools. LlamaIndex is an
optional dependency:
pip install "langchain-flopsindex[llamaindex]"
from langchain_flopsindex.llamaindex import get_flopsindex_llamaindex_tools
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
tools = get_flopsindex_llamaindex_tools()
agent = ReActAgent.from_tools(tools, llm=OpenAI(model="gpt-4o-mini"))
print(agent.chat("Fact-check: is FLOPS-A100-SPOT around $1.20? Give me the verify link."))
Public API
All calls hit the public, key-free FLOPS surface at https://app.flopsindex.com:
GET /v1/price/{slug}— authoritative single-index record (cite from this)GET /v1/search?q={query}— discover slugsGET /v2/catalog/public— every public index with valueGET /v1/verify?index_id={slug}&value={n}— fact-check a claimed value
No authentication is used or sent. If you need real-time, full-precision,
regional, or historical data, contact team@flopsindex.com about partner
access. See also the flopsindex Python SDK
and the flopsindex-mcp MCP server.
License & attribution
Apache-2.0. © 2026 FLOPS Index. Source: github.com/zeroatflops.
The license covers this adapter's source code; the hosted index, methodology,
price data, and the FLOPS trademark remain proprietary to FLOPS Index (see
NOTICE).
Metadata
Release files for langchain-flopsindex 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_flopsindex-0.1.1.tar.gz | 16.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_flopsindex-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.7 kB
Release files / langchain_flopsindex-0.1.1.tar.gz
| Download URL | langchain_flopsindex-0.1.1.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b05af2c0a997b68e88f9cefe0351a661ad2a6d77781812962f3a6ae30032dc5e
|
|
BLAKE2b-256 checksum How to use checksums |
7ba3a075324fbd4c15783beb50ebf4169c27bc6c814d37bba432303e18de3dfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / langchain_flopsindex-0.1.1-py3-none-any.whl
| Download URL | langchain_flopsindex-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbc1e6256f410e47cda4c8b6a2a294de3fd3abe1fb55d155d39f4a1f096efb1b
|
|
BLAKE2b-256 checksum How to use checksums |
9f69703cbb565acf8dea1da53d3cf9d5b6e8a632a8dd00d6bb8310d8f571bc7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|