-
Notifications
You must be signed in to change notification settings - Fork 309
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
add api, distributed setup #135
base: main
Are you sure you want to change the base?
Conversation
src/ell/studio/config.py
Outdated
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
def model_post_init(self, __context): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should let us do Config() instead of Config.create() and have the same functionality
# This intends to honor the default we had set in the CLI | ||
storage_dir = os.getcwd() | ||
# todo. better default? | ||
self.storage_dir = os.getcwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m ending up with SQLite dbs in various places. Maybe we standardize on ell home as a default?
src/ell/studio/connection_manager.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me know if you want to restore this. Broadcast was replicated in the new “pub sub” interfaces. connection moved to the ws handler.
There’s an error in the api implementation where a parent invocation isn’t in the db at the time a child is being written. Investigating. |
I can't repro this in tests. Can't repro it with sqlite either. So I think it's something wrong with the rest api implementation, differences between sqlite and postgres, or a race condition that the api/postgres impl encounters but sqlite doesn't.
|
Adding |
My big question here is can we have su[prot for both this server client version and one version where we actually still ahve sqlite? |
@MadcowD Yes :) I took care to preserve that. it should work just as it did before. the distributed implementation is completely optional but works the same |
we're gonna merge i swear to god |
From yesterday’s discussion:
|
OK, so what we should do here is ref factor studio to be a bit more self-contained in the package having a separate L_studio package and self containing all of the docker file related stuff in one directory so as to not confuse developers. That would make this a bit more clean |
Can try this weekend |
This PR aims to provide a unified architecture for two primary use cases:
To support ell’s features across both, we add a pub sub implementation to enable realtime updates when ell is used with network databases.
A new api server allows the core library to delegate responsibility for writing lmps and traces in a distributed context. This also creates space for ell’s backend to grow, to the extent it may write to multiple databases or other backend services. In this pr, it writes to the configured database and broadcasts its writes to the pub sub implementation.
Studio has been updated to optionally subscribe to these broadcasts and republish them to websocket clients.
If this is ok here would be next steps:
track
I should probably mention I do not have mastery in Python. Overall things seem to work but more testing would be good.
Breaking changes