# Plr server

**URL:** <https://discuss.pylabrobot.org/t/plr-server/147>\
**Category:** General\
**Created:** [February 3, 2025, 3:44am UTC](https://discuss.pylabrobot.org/t/plr-server/147 "2025-02-03T03:44:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickwierenga](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/rickwierenga/32/963_2.png) [@rickwierenga](https://discuss.pylabrobot.org/u/rickwierenga)\
**Post date:** [February 3, 2025, 3:44am UTC](https://discuss.pylabrobot.org/t/plr-server/147/1 "2025-02-03T03:44:06Z")

</div>

following [PLR Dev Roadmap 2025 - Q1 & Q2 - #2 by koeng](https://discuss.pylabrobot.org/t/plr-dev-roadmap-2025-q1-q2/143/2)

This post is to brainstorm about the plr server.

The main way to interact with PLR is through the Python interface. There is a tiny server in [plr.server](https://github.com/PyLabRobot/pylabrobot/tree/main/pylabrobot/server), but it’s underdeveloped.

It would be cool if the server has an api like this:

```auto
/<module>/<device_id>/<command>

```

eg

```auto
/lh/0/aspirate

```

Soon I will create a registry where every frontend class registers and deregisters on setup/stop (for a separate feature).

For frontends, it should be possible to create a dynamic server that creates an endpoint for every method, accepting the kwargs in json (for Resources we might need to use their name rather than a full serialized object).

There should also be an api for (un)assigning resources.

## clients

The interface to the plr server can obviously be any client that speaks http. One interesting way, which partially exists right now, is through the PLR HTTPBackend.

 ![image](https://discuss.pylabrobot.org/uploads/default/original/1X/bb32018e5c24bd5347a8d05da24c6518dd9d7775.png)

Here, users just use PLR like they are used to. Under the hood though, commands are sent to a server rather than the machine directly. On the server there’s a second lh instance (on the server side) that gets all commands and sends it to a backend of choice. Theoretically, it would be possible to chain this, but the backend on the server will probably be one connected to an actual machine.

---

<div class="post-metadata">

**Author:** ![koeng](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/k/4af34b/32.png) [@koeng](https://discuss.pylabrobot.org/u/koeng)\
**Post date:** [February 3, 2025, 5:38pm UTC](https://discuss.pylabrobot.org/t/plr-server/147/2 "2025-02-03T17:38:17Z")

</div>

> Here, users just use PLR like they are used to. Under the hood though, commands are sent to a server rather than the machine directly.

I really like this architecture, and especially the api like `/<module>/<device_id>/<command>`. The reason I think it is cool is because you can then have defined workstations with a specific API backing it that one could develop against. Protocols therefore become much more shareable, and can be written in any language.
