Skip to content

Conversation

@gabrielrfg
Copy link
Contributor

What was done in this PR:

Added events to the startup process of tracking, ui and engine.
This removes the race conditions we were experiencing repeatedly, also removes the need to run start_server() as early as possible.
This works on an event-based architecture:

  1. Every server startup function passed to start_server_component is passed an event. The responsability is of this function to, at some point, run event.set()
  2. Using the @app.on_event("startup") callback mechanism, the event is set
  3. The event is waited through event.wait(), this locks everything down until the server actually starts

How it was tested:

Simple scripts that were failing before, can run further testing

Additional notes:

Did not implement UI waiting, it runs event.set() without waiting, might want to add some actual on_start callbacks
Did not implement timeouts, it's very easy to do, but doesn't seem very necessary

  • Any performance improvements?
    It is no longer a russian roulette to run llmstudio

@gabrielrfg gabrielrfg changed the base branch from main to develop September 9, 2024 10:55
@gabrielrfg gabrielrfg merged commit e110a46 into develop Sep 9, 2024
@gabrielrfg gabrielrfg deleted the fix/start-server-behavior branch September 9, 2024 10:55
@diogoncalves diogoncalves mentioned this pull request Sep 9, 2024
claudiolemos added a commit that referenced this pull request Sep 9, 2024
## LLMstudio Version 0.3.11

### What was done in this version:

- Updated the method input_to_string in provider.py to ensure
compatibility with vision models -- [PR
126](#126)
- Added events to the startup process of tracking, ui and engine. This
removes the race conditions we were experiencing repeatedly, also
removes the need to run start_server() as early as possible -- [PR
129](#129).
- Improved exception handling for invalid Azure endpoints -- [PR
129](#129).


### How it was tested:

- Ran projects with LLMStudio server dependencies

### Additional notes:

- Any breaking changes? 
    - No
- Any new dependencies added?
    - No
- Any performance improvements?
- Yes. Servers will be launched synchronously preventing parent PIDs to
call LLMStudio before being up.
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.

4 participants