Streaming and longer context lengths for LLMs on Workers AI
Nov 14, 2023Jesse Kipp, Celso Martinho

Summary
This post introduces streaming response capabilities for all LLMs on Workers AI, enabling token-by-token delivery of responses using Server-Sent Events (SSE). It also announces increased context and sequence lengths for the Llama-2 model (from 768/256 to 2048/1800 for int8, and 3072/2500 for fp16) and the addition of a 16-bit full-precision Llama-2 variant. Examples are provided for using SSE with the REST API and a Worker script, along with client-side JavaScript for consuming the event stream.
More from the Artificial Intelligence Integration & Impact trail
- Introducing Clef-omni with full multimodality, plus a faster Clef and a cheaper Clef-flash
- Introducing Web Search API via AI Gateway
- Introducing Clef: our open-source decision models, and new RL fine-tuning platform
- One year later: Sovereign AI and the fight for choice
- AI Search is now generally available