Commit graph

38 commits

Author SHA1 Message Date
kingbri
d7eb580e99 Start: Fix uv check
In Windows, checking for a command yields a FileNotFound error if
the utility isn't found. This led to complicated logic which can
be solved by using which instead.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-08-21 18:23:42 -04:00
kingbri
4036c70d75 Tree: Format
Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-08-19 22:59:26 -04:00
kingbri
1f4186512e Start: Add check for uv
Uv is the definitive package installation tool for Python, so add
support to check for it via the start script.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-08-19 22:57:03 -04:00
kingbri
30a3cd75cf Start: Migrate options from cu121/118 to cu12
This encapsulates more cuda versions and makes install easier for
new users.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-08-19 22:56:58 -04:00
David Allada
4196bb6bc8
Update the behavior of start.py so that we can do a full build AND sa… (#293)
* Update the behavior of start.py so that we can do a full build AND save the options, so we can build in a docker image

* Add actual args RIP

* Start: Move start_options write before dependency install message

This ensures that start options are properly written before
determining to exit.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>

---------

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
Co-authored-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-03-11 23:54:34 -04:00
kingbri
153dac496c Args: Fix imports and handling of export openapi
The api-servers arg is passed when running subcommands, so use that
instead of replicating the arg again.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-02-10 23:19:44 -05:00
kingbri
30ab8e04b9 Args: Add subcommands to run actions
Migrate OpenAPI and sample config export to subcommands "export-openapi"
and "export-config".

Also add a "download" subcommand that passes args to the TabbyAPI
downloader. This allows models to be downloaded via the API and
CLI args.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
2025-02-10 23:14:22 -05:00
kingbri
bd16681825 Start: Mark cuda 11.8 as unsupported
Temporary until existing cuda 11.8 scripts can be migrated to cuda 12.

Signed-off-by: kingbri <8082010+bdashore3@users.noreply.github.com>
2025-01-12 21:50:41 -05:00
kingbri
5380b3fe5e Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-09-21 14:37:01 -04:00
kingbri
3c8384ee71 Start: Fix startup with new argparser
Since the full argparser requires pydantic, gate it until all dependencies
are installed.

Also if the venv is deleted, assume that start_options.json is invalid
as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-09-21 14:36:21 -04:00
kingbri
aa832b8627 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-09-10 20:57:13 -04:00
kingbri
810cd40016 Start: Broadcast start_options only on first-time run
Prevents the save from occurring multiple times for no reason.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-09-10 12:19:54 -04:00
kingbri
34281c2e14 Start: Add --force-reinstall argument
Forces a reinstall of dependencies in the event that one is corrupted
or broken.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-04 11:14:38 -04:00
kingbri
ab6c3a53b9 Start: Remove eager upgrade strategy
This will upgrade second-level pinned dependencies to their latest
versions which is not ideal.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-04 10:50:57 -04:00
kingbri
8ff2586d45 Start: Fix pip update, method calls, and logging
platform.system() was not called in some places, breaking the
ternary on Windows.

Pip's --upgrade flag does not actually update dependencies to their
latest versions. That's what the --upgrade-strategy eager flag is for.

Tell the user where their start preferences are coming from.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-04 10:30:26 -04:00
kingbri
b6d2676f1c Start: Give the user a hint when a module can't be imported
If an ImportError or ModuleNotFoundError is raised, tell the user
to run the update scripts.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-03 21:59:06 -04:00
kingbri
b795bfc7b2 Start: Split some prints up
Newlines can be helpful at times.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-03 15:14:40 -04:00
kingbri
65e758e134 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-03 15:08:24 -04:00
kingbri
7ce46cc2da Start: Rewrite start scripts
Start scripts now don't update dependencies by default due to mishandling
caches from pip. Also add dedicated update scripts and save options
to a JSON file instead of a text one.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-08-03 13:03:24 -04:00
kingbri
5c082b7e8c Async: Add option to use Uvloop/Winloop
These are faster event loops for asyncio which should improve overall
performance. Gate these under an experimental flag for now to stress
test these loops.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-07-24 18:59:20 -04:00
kingbri
4087586449 Start: Create config.yml if it doesn't exist
While TabbyAPI doesn't need a config.yml to run, new users can get
confused by the task of copying config_sample.yml to config.yml.
Therefore, automatically do this in the start script to immediately
expose options to the user.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-05-26 21:37:52 -04:00
kingbri
2da3fb2caf Start: Bump ROCm error version
ROCm support is for 6.0 now. Update that.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-05-11 21:57:51 -04:00
kingbri
3d14283fe0 Start: Lint
Signed-off-by: kingbri <bdashore3@proton.me>
2024-04-13 12:25:41 -04:00
kingbri
4d158dac90 Start: Fix when reading from gpu_lib file
The wrong variable was being set, so fix that.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-04-13 12:24:30 -04:00
kingbri
de41e9f7e9 Start: Add gpu_lib argument
Argument to override the selected GPU library. Useful for daemoniztion
when running for the first time.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-04-08 23:33:19 -04:00
kingbri
8bdc19124f Start: Fix gpu lib when reading from file
Readline doesn't strip out newlines or spaces.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-04-02 22:04:01 -04:00
kingbri
44b7319710 Start: Print pip install command
Helps for debugging.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-03-21 18:14:48 -04:00
kingbri
1e7cf1e5a4 Start: Prompt user for GPU/lib
There is no platform agnostic way to fetch CUDA/ROCm's versions
since environment variables change and users don't necessarily need
CUDA or ROCm installed to run pytorch (pytorch installs the necessary
libs if they don't exist).

Therefore, prompt the user for their GPU lib and store the result in
a textfile so the user doesn't need to constantly enter a preference.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-03-20 15:21:37 -04:00
kingbri
72b08624a3 Start: Update to use pyproject
Signed-off-by: kingbri <bdashore3@proton.me>
2024-03-20 15:21:37 -04:00
kingbri
1ec8eb9620 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-03-13 00:02:55 -04:00
kingbri
b373b25235 API: Move to ModelManager
This is a shared module  which manages the model container and provides
extra utility functions around it to help slim down the API.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-03-12 23:59:30 -04:00
kingbri
78f920eeda Tree: Refactor code organization
Move common functions into their own folder and refactor the backends
to use their own folder as well.

Also cleanup imports and alphabetize import statments themselves.

Finally, move colab and docker into their own folders as well.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-01-25 00:15:40 -05:00
kingbri
ceb388e8a0 Start: Override ROCm env variables
These are used for supporting GPUs that are not on the "officially
supported list".

Signed-off-by: kingbri <bdashore3@proton.me>
2024-01-02 21:01:18 -05:00
kingbri
bb7a8e4614 Config: Add override argparser
Add an argparser that casts over to dictionaries of subgroups to
integrate with the config.

This argparser doesn't contain everything in the config due to complexity
issues with CLI args, but will eventually progress to parity. In addition,
it's used to override the config.yml rather than replace it.

A config arg is also provided if the user wants to fully override the
config yaml with another file path.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-01-01 14:27:12 -05:00
kingbri
f56221ff0c Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-12-28 00:31:59 -05:00
kingbri
ee84d892b8 Start: Add shell script
Same as the batch file. Also edit the python script to work when
a venv is clean.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-12-27 23:53:14 -05:00
kingbri
ac0d6f8869 Tree: Format and cleanup start
Signed-off-by: kingbri <bdashore3@proton.me>
2023-12-27 01:17:31 -05:00
kingbri
4d83d1aae4 Start: Switch to python script
Direct python can be used for requirements checking. Remove the ps1
script and create a venv purely in batch.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-12-27 00:37:53 -05:00