Extensible LLM provider system
Project description
Prompter: Extensible LLM Provider System
Prompter is a flexible, plugin-style Python framework for working with multiple Large Language Model (LLM) providers. It supports dynamic provider loading, robust error handling, and unified response parsing, making it easy to integrate, extend, and use in any open source or production environment.
Features
- Plugin-style LLM providers: Easily add or swap providers (OpenAI, Cohere, Anthropic, etc.)
- Optional SDKs: Only install what you need; clear errors if a provider's SDK is missing
- Unified response handling: Consistent, type-safe output from all providers
- Prompting flexibility: Use prompt templates or build prompts programmatically
- Extensible and testable: Add new providers or prompt strategies with minimal code
Concepts
1. Prompt Creation
- Template File Way: Define prompts in external template files (e.g., Jinja2, plain text) and load them at runtime. This enables easy prompt management and reuse.
- Programmatic Way: Build prompts dynamically in code using string formatting, f-strings, or other logic. This is useful for advanced or highly dynamic use cases.
2. Service Providers
- Each provider (OpenAI, Cohere, Anthropic, etc.) is a class with a unified
generatemethod. - Providers are loaded dynamically and only require their SDK if used.
- All providers support structured output via a
result_objectparameter, enabling type-safe parsing of LLM responses.
Usage Example
from prompter.providers import OpenAIService
service = OpenAIService(api_key="sk-...", model="gpt-4")
response = service.generate("What is the capital of France?")
print(response) # "Paris"
Extending
- Add new providers by subclassing and implementing the
generatemethod. - Add new prompt strategies by creating new template loaders or programmatic builders.
License
MIT
Contributing
Pull requests and issues are welcome! Please see CONTRIBUTING.md for guidelines.
Project details
Release history Release notifications | RSS feed
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 falat_prompter-0.1.0.tar.gz.
File metadata
- Download URL: falat_prompter-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1d3f13decef4d1dc839fb3948ea1031b5275f8b7736a10bd4a3903f38e4d55f
|
|
| MD5 |
e0f81e4a1eeb3c7d8282c9785bd43a96
|
|
| BLAKE2b-256 |
e9cc25e1c7b80c1085988c7381a7a0a5673ac30381430d706a2038f330856ab4
|
Provenance
The following attestation bundles were made for falat_prompter-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on falatform/prompter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
falat_prompter-0.1.0.tar.gz -
Subject digest:
e1d3f13decef4d1dc839fb3948ea1031b5275f8b7736a10bd4a3903f38e4d55f - Sigstore transparency entry: 316657637
- Sigstore integration time:
-
Permalink:
falatform/prompter@1d30bfbc18c3d3ba99113daeeafd11dcdad2885f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/falatform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1d30bfbc18c3d3ba99113daeeafd11dcdad2885f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file falat_prompter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: falat_prompter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faf00e8158c18ffe4256cc0fd1e6eea62868bee676a90fa4e6c76c3f81a686de
|
|
| MD5 |
e5be7b51d5de694c22964ac29f8976aa
|
|
| BLAKE2b-256 |
8b25ebee9ebc3ddbb5b4b4613afbe0f6644ba584a79fd28cf1819962a1d76daa
|
Provenance
The following attestation bundles were made for falat_prompter-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on falatform/prompter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
falat_prompter-0.1.0-py3-none-any.whl -
Subject digest:
faf00e8158c18ffe4256cc0fd1e6eea62868bee676a90fa4e6c76c3f81a686de - Sigstore transparency entry: 316657647
- Sigstore integration time:
-
Permalink:
falatform/prompter@1d30bfbc18c3d3ba99113daeeafd11dcdad2885f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/falatform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1d30bfbc18c3d3ba99113daeeafd11dcdad2885f -
Trigger Event:
workflow_dispatch
-
Statement type: