Commit graph

1036 commits

Author SHA1 Message Date
kingbri
cad144126f API: Rename repetition_decay -> repetition_slope
Also fix the fallback to use 0 for sanity checking and validation.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-29 01:13:05 -05:00
kingbri
5cbf7f13da OAI: Fix repetition range
Alias repetition_penalty_range to repetition_range since that's used
as an internal variable. Perhaps in the future, there should be a function
that allows for iterating through request aliases and give a default value.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-29 00:53:19 -05:00
Mehran Ziadloo
b0c42d0f05 Leveraging local variables 2023-11-27 20:56:56 -08:00
Mehran Ziadloo
ead503c75b Adding token usage support 2023-11-27 20:05:05 -08:00
kingbri
44e7f7b0ee Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-25 23:47:48 -05:00
Brian Dashore
0914bc313f
Merge pull request #12 from DocShotgun/main
Add start-up shell script for Linux
2023-11-25 00:29:47 -05:00
kingbri
d929e0c826 API: Fix error points and exceptions
On /v1/model/load, some internal server errors weren't being sent,
so migrate directory checking out and also add a check to make sure
the proposed model path exists.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-25 00:27:02 -05:00
DocShotgun
cffd20f580
Add start-up shell script for Linux
- requires user to have already installed the pre-requisites in venv
2023-11-23 19:03:52 -08:00
kingbri
d47c39da54 API: Don't include draft directory in response
The draft directory should be returned for a draft model request (TBD).

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-23 00:07:56 -05:00
kingbri
13c9c09398 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-22 00:20:21 -05:00
kingbri
d25310e55d Requirements: Update Flash Attention 2
Use 2.3.4 from tgw. However, keep the 2.3.3 wheels in requirements
if the newer wheels don't work for now.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-21 22:12:55 -05:00
kingbri
71b9a53336 API: Add temperature_last support
Documented in previous commits. Also make sure that for version checking,
check the value of kwargs instead of if the key is present since requests
pass default values.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-21 21:20:59 -05:00
turboderp
3337fe6acc Warning if unsupported samplers are used 2023-11-21 18:35:22 +01:00
turboderp
a54de11cf3 Add new samplers 2023-11-21 18:16:53 +01:00
kingbri
c92ee24bb4 Tree: Add batch script
A simple batch script to activate a venv and start TabbyAPI. This
can be used with nssm in Windows for a systemd-like background service.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-20 01:48:06 -05:00
kingbri
2aa9c145be Auth: Fix an oops with headers
I copy pasted the code wrong.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-20 00:16:12 -05:00
kingbri
39ea730be5 Auth: Allow admin keys to work with api key routes
Admin keys are an administrator key, so it makes sense to allow it
for API key routes as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 23:53:07 -05:00
turboderp
8ef730f016
Merge pull request #11 from veden/patch-1
Fix incorrect ratio calculation for draft model
2023-11-20 04:23:34 +01:00
Veden
f960fac8ff
Fix incorrect ratio calculation for draft model 2023-11-19 13:12:53 -08:00
kingbri
4cddd0400c Model: Fix draft model loading
Use draft_config to find the path instead of kwargs.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 02:04:02 -05:00
kingbri
698b0b1976 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 01:19:31 -05:00
kingbri
581e1fc219 Sample config: Remove unused value
Draft models are specified in the draft sublock.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 01:16:03 -05:00
kingbri
e0e93c103b Sample config: Uncomment all parameters
This helps clarify things when users are configuring for the first
time. For example, some users were putting the model name in the
"model" block instead of the "model_name" field.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 01:12:07 -05:00
kingbri
63762654f0 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 01:05:49 -05:00
Brian Dashore
e46676cb08
Merge pull request #9 from city-unit/main
Add basic docker support
2023-11-19 00:53:24 -05:00
kingbri
e4a8848445 Auth: Log API and admin key on startup
Helpful for users who run headless or use Docker.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 00:52:39 -05:00
kingbri
31bc418795 Model: Add context in response output
When printing to the console, give information about the context
(ingestion token count).

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 00:49:32 -05:00
city_unit
80c69939ae Remove unneeded stuffs 2023-11-19 00:34:54 -05:00
kingbri
f47919b1d3 API: Add draft model support
Models can be loaded with a child object called "draft" in the POST
request. Again, models need to be located within the draft model dir
to get loaded.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-19 00:32:25 -05:00
city_unit
6b22dc0119 Rename, fschat support 2023-11-19 00:32:14 -05:00
city_unit
99cf0b6d7b Add basic docker support 2023-11-19 00:01:17 -05:00
kingbri
6b9af58cc1 Tree: Fix extraneous bugs and update T/s print
Model: Add extra information to print and fix the divide by zero error.
Auth: Fix validation of API and admin keys to look for the entire key.

References #7 and #6

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-18 22:34:40 -05:00
kingbri
a51889bdb8 Requirements: Update Flash Attention
Bump to version 2.3.3.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-18 22:28:24 -05:00
Brian Dashore
b2410a0436
Merge pull request #4 from waldfee/config_samples
Adds draft model support to config.yml
2023-11-18 13:16:23 -05:00
kingbri
27ebec3b35 Model: Add speculative decoding support via config
Speculative decoding makes use of draft models that ingest the prompt
before forwarding it to the main model.

Add options in the config to support this. API options will occur
in a different commit.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-18 01:42:20 -05:00
kingbri
2ad79cb9ea Model: Add tokens in responses
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 23:33:48 -05:00
kingbri
7f18ea1d7c Tree: Remove SillyTavern shim docs
Support has been added in SillyTavern's staging branch.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 22:03:46 -05:00
kingbri
6f2078cbe4 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 22:02:21 -05:00
kingbri
d627d14385 API: Fix exceptions and defaults
Stop conditions was None, causing model to error out when trying to
add the EOS token to a None value.

Authentication failed when Bearer contained an empty string. To fix
this, add a condition which checks array length.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 17:56:05 -05:00
waldfee
78a6587b95 add cache_mode and draft_model_dir to config_sample.yml 2023-11-17 22:08:31 +01:00
kingbri
4669e49ff0 API: Fix errors with token endpoint
Handle None cases if the provided text/token lists are empty.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 01:39:06 -05:00
kingbri
9dfa580b1e Model: Add tokens/second output
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 01:16:20 -05:00
kingbri
021981fce0 API: Re-add depends endpoints
Mistakenly removed API key authentication for the models endpoints in
testing.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-17 00:50:42 -05:00
kingbri
ac4e9c2277 API: Add CORS support
Tell CORS to go fly a kite.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 22:19:47 -05:00
kingbri
08a183540b Config: Add warning on exceptions and clarify parameters
Due to how YAML works, double quotes are bad. Specify a linter in
the top of the config_sample file.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 22:19:47 -05:00
Splice86
feef782dbf
Update requirements.txt to include uvicorn 2023-11-16 22:50:27 +00:00
Brian Dashore
d5374c2c1f
Create LICENSE
Use AGPLv3 for this project

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 17:43:23 -05:00
kingbri
2cf93c092b Add SillyTavern instructions
Temporary until proper support is added in.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 17:33:23 -05:00
kingbri
b20e71dcd4 Requirements: Add Flash Attention 2 wheels
Update to 2.3.3 at some point.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 17:25:00 -05:00
kingbri
d5551352bf Model: Fix parsing of stop conditions
Add the EOS token into stop strings after checking kwargs. If
ban_eos_token is on, don't add the EOS token in for extra measure.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 17:15:33 -05:00