Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated API Support #525

Open
wants to merge 18 commits into
base: united
Choose a base branch
from
Open

Updated API Support #525

wants to merge 18 commits into from

Conversation

Iceblade02
Copy link

Previous PR was closed due to restructuring of the fork, essentially just separating my dev branch from the united branch as the current version is "stable".

Main features:

  • api_handler is a unified base that makes adding support for new online providers easy.
    • Includes support for parallelized batched calls (theoretically unlimited)
    • Simple stoppers such as single line or end of sentence
    • Calls in pure text form (chat etc. can still be used client side, but the benefits of models supporting chat format will not be available)
    • Customizable time out.

Currently supported providers:

  • OpenRouter (Probably all models)
  • OpenAI (only some models)
  • MancerAI (Tested on free models)
  • GooseAI (Probably all models)

Will continue sporadic work on additional features in my /dev branch, but the PR should be considered complete.

	* Edited 3 rows in aiserver.py, the first to add the menu item, second in order to not request gpu/cpu and third for the ModelSelectionSchema class.
	* The openrouter_handler takes care of generations, with features such as:
		- Messy code
		- Some remaining TODOs
		- Core story generation, including support for story & simple chat
		- Some simple stoppers
		- Parallelized api calls for getting batched generations
		- and some comments
The code *should not* affect anything outside its scope, but should *definitely* be glanced at by someone more experienced than me.
This was a WIP file that never should have been added in the first place.
Slightly reworked get_requested_parameters in order to let key from parameters overwrite saved key.
…ed almost all OpenRouter specific bits into the proper class.py

After doing that, added support for Mancer as well, which went shockingly fast and very smoothly.
TODO: Some settings that are still in api_handler should probably be moved to their respective class.py files.
Note: Mancer does not appreciate batch calls and sends a 400-method not allowed reply. May be allowed as a paying customer.
		* Further testing is required.
Something of a proof-of-concept that this can work as a general, modernised API backend.
…fied.

* Slight changes in mancer/class.py & openrouter/class.py to accomodate this.
* Moved the gooseAI API over to the new handler.
* Removed references to API-specific settings such as frequency & presence penalties.
* Moved handling of settings file read/write to newly added read/write functions
* Reworked get_requested_parameters (henceforth grp) to only open the settings file once & make it more easily readable
* Removed unused packages.

In openrouter/class.py
* Removed unused packages
* Added handling of frequency and presence penalties in grp

In mancer/class.py
* Removed unused packages
* Added handling of frequency and presence penalties in grp

In gooseai/class.py
* Removed unused packages
* Added handling of presence penalties in grp
…ies.

Removed loading of specific settings in models.
self.key=timeout -> self.timeout=timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant