Skip to content

feat: real-time streaming output examples for Crusoe Managed Inference#59

Open
Sakshi3027 wants to merge 1 commit into
crusoecloud:mainfrom
Sakshi3027:feat/streaming-crusoe
Open

feat: real-time streaming output examples for Crusoe Managed Inference#59
Sakshi3027 wants to merge 1 commit into
crusoecloud:mainfrom
Sakshi3027:feat/streaming-crusoe

Conversation

@Sakshi3027

Copy link
Copy Markdown

What this adds

Four streaming demos for Crusoe Managed Inference covering every common streaming pattern.

Demo What it shows
Basic streaming Stream tokens to stdout as they arrive
Callback handler Stream via StreamingStdOutCallbackHandler
Async streaming Non-blocking token generation with astream
Concurrent streaming 3 prompts streamed simultaneously

Why it's useful

Streaming is essential for production LLM apps it makes responses feel instant instead of making users wait for the full output. There are currently no streaming examples in the solutions library despite it being one of the most requested patterns.

Notable result: 3 concurrent async streams completed in 0.50s.

Testing

All 4 demos run successfully. Tested locally with Groq as a drop-in replacement.

To run on Crusoe:
export CRUSOE_API_KEY="your-api-key"
python streaming.py

Related contributions

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.

1 participant