LMITF DocumentationΒΆ
LMITF (Large Model Interface) is a flexible Python library that provides a unified interface for interacting with large language models (LLMs) and large vision models (LVMs). It simplifies the process of working with various AI models through aggregated API platforms.
β¨ Key FeaturesΒΆ
Simple and intuitive API for both text and vision model interactions
Support for custom API endpoints and environment-based configuration
Track API costs and usage with integrated pricing functionality
Pre-built templates for common AI tasks and custom prompt management
π Quick Start
Installation
pip install lmitf
Basic Usage
from lmitf import BaseLLM
# Initialize the LLM client
llm = BaseLLM()
# Simple text generation
response = llm.call("Hello, how are you?")
print(response)
# JSON mode for structured output
data = llm.call_json("Generate a person's profile", model="gpt-4o")
print(data)
π Documentation Structure
API Reference
Advanced Topics
Development
π― Core Components
BaseLLM
The main interface for text-based language models, supporting both streaming and non-streaming responses.
BaseLVM
Specialized interface for vision-language models that can process both text and images.
TemplateLLM
Template-based system for managing and reusing common prompts and workflows.
Pricing Module
Built-in cost tracking and API usage monitoring for better resource management.
π External Links
GitHub Repository: https://github.com/colehank/AI-interface
PyPI Package: https://pypi.org/project/lmitf/
Issue Tracker: https://github.com/colehank/AI-interface/issues
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π¨βπ» Author
Guohao Zhang - guohao2045@gmail.com
Getting Help
If you need help or have questions:
Check the examples section
Browse the API reference
Open an issue on GitHub