docs: add FastAPI backend example for non-Node.js setups#540
Merged
vishxrad merged 3 commits intoMay 26, 2026
Conversation
vishxrad
requested changes
May 24, 2026
| @@ -0,0 +1,2 @@ | |||
| OPENAI_API_KEY=sk-your-key-here | |||
| OPENAI_MODEL=gpt-5.2 | |||
Contributor
There was a problem hiding this comment.
please change the model to gpt-5.5. we have a standard model across all examples.
ritvik-thesys
approved these changes
May 26, 2026
vishxrad
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
examples/fastapi-backend/— a minimal chat app using a FastAPI (Python) backend instead of Next.js.Why
Every example in the repo uses a Node.js runtime (Next.js, SvelteKit, Nuxt). This example demonstrates that OpenUI is backend-agnostic: the same React frontend works with any server that emits the correct stream format.
The frontend (
App.jsx) is identical to the one scaffolded bynpx @openuidev/cli create— no changes were needed to switch from Next.js to FastAPI.What's included
{ systemPrompt, messages }, calls the OpenAI streaming API, and yields NDJSON chunksopenAIReadableStreamAdapter()to parse the stream — same asgenui-chat-appTested
gpt-5.2model