fhlmi
A client to provide LLM responses for FutureHouse applications.
What it is and what it does
fhlmi is a Python library that abstracts away the differences between multiple large language model providers, letting you write code once and swap providers without changing your application logic. It wraps providers under a common async interface, exposing methods like `call_single()` and `call()` that accept text or structured messages.
The library handles several operational concerns automatically: it tracks token usage and cost per request, enforces rate limits (tokens per minute and requests per minute) with in-memory or Redis-backed storage, retries failed requests, and supports tool calling and structured output schemas. You configure providers and limits through a config dictionary, then call the LLM through the unified interface—no need to learn each provider's API separately.
Use it for:
- Build a multi-provider LLM application where you can switch between providers by changing config without rewriting code.
- Enforce rate limits across concurrent requests to avoid hitting provider quotas or incurring unexpected costs.
- Track token usage and cost per LLM call to monitor spending and optimize prompt efficiency.
- Implement tool calling against multiple LLM providers using a single abstraction.
- Embed LLM capabilities in async Python services that need retries, timeouts, and cross-process rate limiting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
fhlmi provides a unified async Python interface to multiple large language models, handling authentication, rate limiting, cost tracking, and tool calling across different LLM providers.
Yes, if you need a unified interface to multiple LLM providers with built-in rate limiting and cost tracking. The library is actively maintained, has low install friction, and is permissively licensed. However, verify that all runtime dependencies fit your environment before committing; the dependency footprint is substantial.
Install
fhlmi on PyPI
pip
pip install fhlmiuv
uv add fhlmipoetry
poetry add fhlmiInstalling fhlmi
Before you install
Low friction install with a pure Python wheel. Active maintenance (last commit 2026-08-12, 10 days since release) and 139 repository stars suggest ongoing development. Requires Python 3.11 or later.
License in practice
Apache License 2.0 is permissive: you can use, modify, and distribute fhlmi freely in commercial and private projects, provided you include a copy of the license and document any changes you make.
Quickstart
pip install fhlmi
from fhlmi import LiteLLMModel
llm = LiteLLMModel()
result = await llm.call_single("What is the meaning of life?")
Requires Python 3.11 or later; async/await context required; LLM provider credentials must be set in environment.
Verify before relying
- Whether all 10 runtime dependencies are required for basic usage or if some are optional.
- Whether fhaviary is a public package or an internal dependency that may affect installation.
- Cost estimation accuracy and which LLM providers' pricing models are supported.
- Whether Redis is required for rate limiting or if in-memory storage is sufficient for typical workloads.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — aiohttp, coredis, fhaviary, limits, litellm, openai, orjson, pydantic, tenacity, tiktoken |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 173,969/month — #10,294 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fhlmi-1.0.5-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
unclecode-litellmUnified Python interface to call many LLM…
permissive · top 5,000 on PyPI
lexisnexisapiProvides a Python interface to the LexisNexis…
permissive · top 15,000 on PyPI
litellm-enterpriseLiteLLM Enterprise provides a unified Python…
unclear · top 5,000 on PyPI
tokencostCounts tokens and estimates USD costs for LLM…
permissive · top 15,000 on PyPI
any-llm-sdkProvides a unified Python interface to…
permissive · top 15,000 on PyPI
g4fAggregates multiple LLM and media-generation…
unclear · top 15,000 on PyPI
llmlinguaLLMLingua compresses prompts by identifying and…
permissive · top 15,000 on PyPI
llm-github-modelsA plugin for the llm command-line tool that…
permissive · top 15,000 on PyPI
llm-openai-pluginA plugin that extends LLM to access OpenAI…
permissive · top 15,000 on PyPI