skillfed

fhlmi

A client to provide LLM responses for FutureHouse applications.

fhlmi v1.0.5 174.0K downloads/30d#10,294 on PyPI139
Permissive 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) Active released

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 fhlmi

uv

uv add fhlmi

poetry

poetry add fhlmi

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

unified llm interfacemulti-provider language model clientllm rate limiting and cost trackingasync llm wrapperlanguage model abstraction layerllm tool callingcost tracking for language models
llm-abstractionrate-limitingcost-tracking

More Artificial Intelligence packages