diversen / tiny-gpt-client
A tiny GPT client for PHP
Installs: 78
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/diversen/tiny-gpt-client
Requires (Dev)
- phpunit/phpunit: ^10.0
README
A tiny GPT client with no dependencies.
Installation
composer require diversen/tiny-gpt-client
Usage
The API has methods for completions and chat completions
- /completions
- /chat/completions
For both endpoints there is streaming and non-streaming responses.
When streaming the response the token usage is calculated using
a Token
class. This may not be an exact calculation.
When using the non-streaming response the usage of tokens should be exact.
Usage example
See: example
License
MIT © Dennis Iversen