LMITF DocumentationΒΆ

PyPI Version Python Versions License

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¢

πŸš€ Easy to Use

Simple and intuitive API for both text and vision model interactions

πŸ”§ Flexible Configuration

Support for custom API endpoints and environment-based configuration

πŸ“Š Built-in Pricing

Track API costs and usage with integrated pricing functionality

🎯 Template System

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

🎯 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.

πŸ“„ 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: