Commit graph

79 commits

Author SHA1 Message Date
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
kingbri
282b5b2931 API: Fix responses and some params
Responses were not being properly sent as JSON. Only run pydantic's
JSON function on stream responses. FastAPI does the rest with static
responses.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 17:11:55 -05:00
kingbri
d8d61fa19b API: Add fallback if model isn't loaded
Most endpoints require the model to be loaded, so add a depends.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 12:20:35 -05:00
kingbri
c0525c042e Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 12:06:37 -05:00
kingbri
60eb076b43 Tree: Basic formatting and comments
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 11:48:40 -05:00
kingbri
5defb1b0b4 Config: Fix errors when stuff doesn't exist
Add safe fallbacks if any part of the config tree doesn't exist. This
prevents random internal server errors from showing up.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 11:41:03 -05:00
kingbri
03f45cb0a3 Tree: Update documentation and configs
Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 02:30:33 -05:00
kingbri
2248705c4a Requirements: Don't force fastchat installation
Fastchat requires a lot of dependencies such as transformers, peft,
and accelerate which are heavy. This is not useful unless a user
wants to add a shim for the chat completion endpoint.

Instead, try importing fastchat and notify the console of the error.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-11-16 01:26:46 -05:00