https://github.com/diversen/tiny-gpt-api
A tiny GPT api client for PHP
https://github.com/diversen/tiny-gpt-api
gpt gpt-php
Last synced: 10 months ago
JSON representation
A tiny GPT api client for PHP
- Host: GitHub
- URL: https://github.com/diversen/tiny-gpt-api
- Owner: diversen
- Created: 2023-04-01T11:10:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-07T19:01:13.000Z (over 2 years ago)
- Last Synced: 2025-03-11T09:24:31.313Z (over 1 year ago)
- Topics: gpt, gpt-php
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shell-gpt-php
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](example/index.php)
## License
MIT © [Dennis Iversen](https://github.com/diversen)