Universal LLM Service
Universal LLM service supporting OpenAI, Anthropic, and local models for code analysis and summarization.
Features
- Multi-Provider Support: OpenAI, Anthropic, Azure OpenAI, Google, and local models
- Async Operations: Full async/await support for all LLM operations
- Smart Configuration: Automatic provider detection and configuration
- Response Validation: Built-in response quality validation
- Rate Limiting: Intelligent rate limiting and retry mechanisms
- Type Safety: Complete type annotations with mypy support
- Extensible Design: Easy to add new LLM providers
Installation
# Basic installation
pip install yeonjae-universal-llm-service
# With OpenAI support
pip install yeonjae-universal-llm-service[openai]
# With Anthropic support
pip install yeonjae-universal-llm-service[anthropic]
# With all providers
pip install yeonjae-universal-llm-service[all]
Quick Start
import asyncio
from yeonjae_universal_llm_service import LLMService, LLMInput, LLMProvider, ModelConfig
async def main():
# Initialize service
service = LLMService()
# Create input
input_data = LLMInput(
prompt="Analyze this code and provide insights",
llm_provider=LLMProvider.OPENAI,
model_config=ModelConfig(model="gpt-4", temperature=0.3)
)
# Generate summary
result = await service.generate_summary(input_data)
print(f"Summary: {result.summary}")
print(f"Confidence: {result.confidence_score}")
print(f"Tokens used: {result.metadata.total_tokens}")
asyncio.run(main())
Configuration
Set your API keys as environment variables:
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
Supported Providers
- OpenAI: GPT-3.5, GPT-4, and newer models
- Anthropic: Claude 3 family (Haiku, Sonnet, Opus)
- Azure OpenAI: Enterprise OpenAI deployment
- Google: Gemini and PaLM models
- Local: Custom local model integration
License
MIT License
Metadata
Release files for yeonjae-universal-llm-service 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yeonjae_universal_llm_service-1.0.5.tar.gz | 10.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yeonjae_universal_llm_service-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / yeonjae_universal_llm_service-1.0.5.tar.gz
| Download URL | yeonjae_universal_llm_service-1.0.5.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81bd745f886851524ce30533eb72f576bece7a25238fd605746d90530ddaf5b8
|
|
BLAKE2b-256 checksum How to use checksums |
81537348961e92fd048c43d0343c75b454ab7f1eb2e1dfdc6421cdab6bfe54ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Release files / yeonjae_universal_llm_service-1.0.5-py3-none-any.whl
| Download URL | yeonjae_universal_llm_service-1.0.5-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84777ae9f82f040b0dc049b38f03f20d11f7ed1ebbe22ba6dce82d471170ce58
|
|
BLAKE2b-256 checksum How to use checksums |
3db3d646eae1578852573699b005cdc25987498c3ee9cf28d8857da3dd0efd70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|