# Embedding individual models of a server\_session

**URL:** <https://discourse.bokeh.org/t/embedding-individual-models-of-a-server-session/7241>\
**Category:** Community Support\
**Tags:** website, server\
**Created:** [February 18, 2021, 8:20am UTC](https://discourse.bokeh.org/t/embedding-individual-models-of-a-server-session/7241 "2021-02-18T08:20:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonas](https://discourse.bokeh.org/u/jonas)\
**Post date:** [February 18, 2021, 8:20am UTC](https://discourse.bokeh.org/t/embedding-individual-models-of-a-server-session/7241/1 "2021-02-18T08:20:41Z")

</div>

**What am I trying to do?**

I am running a Bokeh server and embedding it currently with `server_document()` in a flask environment of an external webpage. My Bokeh document contains two parts, let’s say a slider and a figure; I gave both a name and added them to the bokeh document with `add_root()`.

Now I would like to put each of these roots into a separate `div` when embedding, to allow the use of flexboxes to achieve a responsive design. Previously, I used `Column()` or `Row()` of Bokeh Layout, but `Column()` looks bad on a landscape screen and `Row()` looks bad on a mobile device.

**What have I tried that did not work as expected?**

In the reference documentation (section bokeh.embed) I found that if I use `server_session()` over` server_document()`, I can pass a model name to get individual document roots instead of the entire document. However, this does not work. I found this open github issue ([Bring back the functionality needed to embed separate Bokeh roots within React · Issue #8499 · bokeh/bokeh · GitHub](https://github.com/bokeh/bokeh/issues/8499)) that seems to be related but hasn’t seen any activity besides “_is there a fix?_” for about a year. After looking a bit into the source code (I am no expert by any means), it seems like the problem is the _autoload\_request\_tag.html_ ([bokeh.core.templates — Bokeh 2.4.2 Documentation](https://docs.bokeh.org/en/latest/docs/reference/core/templates.html)), which does not make use of the `modelid` that it receives.

Is there any update on this or a suggestion to achieve my goal in another way? I am restricted to using Bokeh Server (I need Python callbacks), so embedding with `components()` is not an option; and because I don’t want Bokeh to serve all the content, I believe also the default Jinja2/directory template method does not work for me. I also cannot use multiple documents, because I want the two models to interact with each other, just like the Bokeh sliders example. I appreciate any advice!

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [February 20, 2021, 10:37pm UTC](https://discourse.bokeh.org/t/embedding-individual-models-of-a-server-session/7241/2 "2021-02-20T22:37:00Z")

</div>

@jonas I am afraid this specific scenario is not well-explored, and I can’t actually give you a definite answer beyond noting that this capability is not currently officially maintained under test or in any examples. It’s definitely possible to embed individual document roots in different places in a template when the Bokeh server is serving the page directly (as demonstrated in [`/examples/app/dash`](https://github.com/bokeh/bokeh/tree/branch-2.3/examples/app/dash)) but I think that `server_session` may need development work to support this use-case. I have put [`#8499`](https://github.com/bokeh/bokeh/issues/8499) in the 2.4 milestone so that it will get some attention after the upcoming 2.3 release.

---

<div class="post-metadata">

**Author:** ![jonas](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonas](https://discourse.bokeh.org/u/jonas)\
**Post date:** [February 22, 2021, 7:33am UTC](https://discourse.bokeh.org/t/embedding-individual-models-of-a-server-session/7241/3 "2021-02-22T07:33:40Z")

</div>

Thank you very much for the reply and for moving the issue to 2.4! Based on the number of forum/github/stackexchange posts and replies mentioning similar setups/desires I believe quite a number of people are looking forward to that feature. As a temporary solution I serve the specific page containing the bokeh plot entirely with bokeh server, just like in the referenced dash example.
