fintom8
LiteLLM connector for Gemini / Vertex AI / OpenAI / Azure. Chat, stream, and document extract. Students install with pip and call a few methods — keys stay in .env.
pip install fintom8
from fintom8 import LLM
llm = LLM() # reads .env / environment
print(llm.chat("Summarize this invoice").text)
Local development from this repo:
pip install -e ./fintom8
# or: pip install -e "./fintom8[dev]"
Configuration
Resolution order: constructor kwargs / LLMConfig > environment > defaults.
Copy .env.example to .env in your project (never commit it).
| Param | Env | Default | When needed |
|---|---|---|---|
model |
LLM_MODEL |
gemini/gemini-3.5-flash |
always |
temperature |
LLM_TEMPERATURE |
0.0 |
optional |
num_retries |
— | 3 |
optional |
api_key |
GEMINI_API_KEY / OPENAI_API_KEY / AZURE_API_KEY (from model prefix) |
unset | Gemini / OpenAI / Azure |
api_base |
AZURE_API_BASE / OPENAI_API_BASE |
unset | Azure (required) |
api_version |
AZURE_API_VERSION |
2024-10-21 |
Azure |
vertex_project |
VERTEXAI_PROJECT |
unset | Vertex |
vertex_location |
VERTEXAI_LOCATION |
eu |
Vertex |
from fintom8 import LLM, LLMConfig
llm = LLM() # env defaults
llm = LLM(model="gpt-4o", api_key="sk-...", temperature=0)
llm = LLM(LLMConfig(
model="azure/my-deploy",
api_key="...",
api_base="https://....openai.azure.com",
api_version="2024-10-21",
))
Switch provider
LLM_MODEL |
Env |
|---|---|
gemini/gemini-3.5-flash |
GEMINI_API_KEY |
vertex_ai/gemini-3.5-flash |
VERTEXAI_PROJECT + VERTEXAI_LOCATION + ADC (gcloud auth application-default login) |
gpt-4o |
OPENAI_API_KEY |
azure/<deployment> |
AZURE_API_KEY + AZURE_API_BASE + AZURE_API_VERSION |
Usage
from fintom8 import LLM
llm = LLM()
resp = llm.chat("Hello")
print(resp.text, resp.usage)
# Structured output — pass field key→type, get a JSON dict back
data = llm.structured(
"Invoice total is 42.5 from Acme",
{"total": "number", "vendor": "string"},
temperature=0,
)
# {"total": 42.5, "vendor": "Acme"}
# Or a full JSON Schema / Python types
data = llm.structured("...", {"total": float, "vendor": str})
data = llm.structured(
"...",
{"type": "object", "properties": {"total": {"type": "number"}}, "required": ["total"]},
)
for chunk in llm.stream([{"role": "user", "content": "Write a haiku"}]):
print(chunk, end="", flush=True)
resp = llm.extract("invoice.pdf", response_schema={...})
Async twins: achat, astream, aextract, astructured.
Helpers: fields_to_schema, json_schema_response_format, enforce_strict, inline_refs.
Failures raise Fintom8Error.
If you see an authentication error (for example missing GEMINI_API_KEY, OPENAI_API_KEY, or Vertex setup), that means package import and retries are working; configure credentials for the selected LLM_MODEL.
See examples/chat.py and examples/extract.py.
Publish (maintainers)
-
Install dev extras and run tests:
cd fintom8 pip install -e ".[dev]" pytest python -c "from fintom8 import LLM"
-
Build:
python -m build
-
Upload to TestPyPI first, then PyPI:
python -m twine upload --repository testpypi dist/* python -m twine upload dist/*
-
Tag for CI Trusted Publishing (OIDC). Create the PyPI project once and add a GitHub environment
pypiwith Trusted Publisher pointing at.github/workflows/publish-fintom8.yml. Then:git tag fintom8-v0.1.0 git push origin fintom8-v0.1.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fintom8-0.1.1.tar.gz.
File metadata
- Download URL: fintom8-0.1.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e5780c8d01482374c4f8cafb75ce1113b0a1072f9441aa7fc63863771fa6655
|
|
| MD5 |
e33259bdf81622964357de0b076c9273
|
|
| BLAKE2b-256 |
1d548993d167c4de351865219d52940e00e03606799222940b2034dcbad03b77
|
File details
Details for the file fintom8-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fintom8-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5645a937362dcbd91aaaaba2edcbdc5322e78fff4edd71d59728535ba45a8c6
|
|
| MD5 |
8395d7f3c68c826e0d7a36f866dd47d3
|
|
| BLAKE2b-256 |
43bfa951cdee46a77432a2f878c0753cd236c4234053082ab5d533ec3010d892
|