Skip to main content

LangChain (and LlamaIndex) tools for the public FLOPS Index — verifiable GPU compute reference prices, no API key required

Project description

langchain-flopsindex

LangChain (and LlamaIndex) tools for the FLOPS Index — verifiable GPU / accelerator rental reference prices, no API key required.

License: Apache 2.0 Live API

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.
  • confidence is 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_url so 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 slugs
  • GET /v2/catalog/public — every public index with value
  • GET /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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_flopsindex-0.1.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_flopsindex-0.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_flopsindex-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_flopsindex-0.1.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for langchain_flopsindex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e32ec410f1870e0404e8436ba574593c2f4d63f8ce25b8ecd3dcb5d32ec3b2d0
MD5 28b6b66dccec7cdc01d0ba71bc88cb03
BLAKE2b-256 fc5c3c07f1b8c10ed12e0950a51b777a3b8141d326fd65e31fa9ef308d367111

See more details on using hashes here.

File details

Details for the file langchain_flopsindex-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_flopsindex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d15d1044a3ec32471cb1914f0055b09c9db047025309a4d279dd1849c3c945d
MD5 3eabc29a673e76708fbef570ba1c9ec0
BLAKE2b-256 2538079937573d9cda42588fbe376494a8f89cbf9f1fb606b432a691e618e3bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page