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")
resp = llm.chat(
[{"role": "user", "content": "Extract the invoice total"}],
response_schema={
"type": "object",
"properties": {"total": {"type": "number"}},
"required": ["total"],
},
schema_name="Invoice",
)
print(resp.text, resp.data, resp.usage)
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 for FastAPI / async scripts: achat, astream, aextract.
Structured-output helpers (also used internally): json_schema_response_format, enforce_strict, inline_refs.
Failures raise Fintom8Error.
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.0.tar.gz.
File metadata
- Download URL: fintom8-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c5c001983c42038d1990cda2d2a2f75a8e5acc960a52390ddbcd6cb7ccbef02
|
|
| MD5 |
db98da1d485fa22e59da2667a187d46f
|
|
| BLAKE2b-256 |
ac55dff0cf610afab1fc3d143ef8616b63fa4a5b9833dd6f72cad21efef7ea7a
|
File details
Details for the file fintom8-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fintom8-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 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 |
7e14642d40b1cf637cf4f36866cb23ea6e1c270662f9c0973db6924f5e0e02c4
|
|
| MD5 |
38405eb953eda4627af453ff96749092
|
|
| BLAKE2b-256 |
ec1a99b4efece6b5b65809fc071709df85dd6cc280bc905482699dc844f5a354
|