<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.stoney-cloud.com/w/index.php?action=history&amp;feed=atom&amp;title=AI_on_Demand%3A_Token_streaming</id>
	<title>AI on Demand: Token streaming - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.stoney-cloud.com/w/index.php?action=history&amp;feed=atom&amp;title=AI_on_Demand%3A_Token_streaming"/>
	<link rel="alternate" type="text/html" href="https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;action=history"/>
	<updated>2026-11-09T16:35:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1310&amp;oldid=prev</id>
		<title>Sst-la1: /* Usage - Inference with token-stream */</title>
		<link rel="alternate" type="text/html" href="https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1310&amp;oldid=prev"/>
		<updated>2026-11-09T15:36:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage - Inference with token-stream&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:36, 9 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#Persönlichen Key setzen&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;STONEY_KEY=&#039;sk-...&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Modell auswählen&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Modell auswählen&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MODEL=&amp;#039;zai-org/GLM-5.3-Flash&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MODEL=&amp;#039;zai-org/GLM-5.3-Flash&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mw_3738417_app?h005:diff::1.12:old-1309:rev-1310 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sst-la1</name></author>
	</entry>
	<entry>
		<id>https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1309&amp;oldid=prev</id>
		<title>Sst-djo: /* Usage - Inference with token-stream */</title>
		<link rel="alternate" type="text/html" href="https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1309&amp;oldid=prev"/>
		<updated>2026-11-09T15:30:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage - Inference with token-stream&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:30, 9 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Chat platforms like LibreChat include native mechanisms for handling token streaming or parsing the stream.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Chat platforms like LibreChat include native mechanisms for handling token streaming or parsing the stream.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The stream: true flag needs to be set.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mw_3738417_app?h005:diff::1.12:old-1308:rev-1309 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sst-djo</name></author>
	</entry>
	<entry>
		<id>https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1308&amp;oldid=prev</id>
		<title>Sst-djo: /* Overview */</title>
		<link rel="alternate" type="text/html" href="https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1308&amp;oldid=prev"/>
		<updated>2026-11-09T15:29:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Overview&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:29, 9 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Overview =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Overview =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This pages describes some useful commands on how to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;test &lt;/del&gt;token streaming.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This pages describes some useful commands on how to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use &lt;/ins&gt;token streaming.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Usage =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Usage =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mw_3738417_app?h005:diff::1.12:old-1307:rev-1308 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sst-djo</name></author>
	</entry>
	<entry>
		<id>https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1307&amp;oldid=prev</id>
		<title>Sst-djo: Created page with &quot;= Overview = This pages describes some useful commands on how to test token streaming.  = Usage = We assume you&#039;ve received your API key from us in our usual manner.  == Usage - Inference with token-stream ==  Regular token streaming is difficult to read in the console.  The expanded command processes the output into a far more digestible format on the console.  Chat platforms like LibreChat include native mechanisms for handling token streaming or parsing the stream.  &lt;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.stoney-cloud.com/w/index.php?title=AI_on_Demand:_Token_streaming&amp;diff=1307&amp;oldid=prev"/>
		<updated>2026-11-09T15:29:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Overview = This pages describes some useful commands on how to test token streaming.  = Usage = We assume you&amp;#039;ve received your API key from us in our usual manner.  == Usage - Inference with token-stream ==  Regular token streaming is difficult to read in the console.  The expanded command processes the output into a far more digestible format on the console.  Chat platforms like LibreChat include native mechanisms for handling token streaming or parsing the stream.  &amp;lt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
This pages describes some useful commands on how to test token streaming.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
We assume you&amp;#039;ve received your API key from us in our usual manner.&lt;br /&gt;
&lt;br /&gt;
== Usage - Inference with token-stream ==&lt;br /&gt;
&lt;br /&gt;
Regular token streaming is difficult to read in the console.&lt;br /&gt;
&lt;br /&gt;
The expanded command processes the output into a far more digestible format on the console.&lt;br /&gt;
&lt;br /&gt;
Chat platforms like LibreChat include native mechanisms for handling token streaming or parsing the stream.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#Modell auswählen&lt;br /&gt;
MODEL=&amp;#039;zai-org/GLM-5.3-Flash&amp;#039;&lt;br /&gt;
&lt;br /&gt;
#Prompt eingeben&lt;br /&gt;
PROMPT=&amp;#039;Hallo, bitte führe meine Prompt aus&amp;#039;&lt;br /&gt;
&lt;br /&gt;
#Tokenlimit setzen&lt;br /&gt;
MAX_TOKENS=2000&lt;br /&gt;
&lt;br /&gt;
#Inference Call&lt;br /&gt;
jq -n \&lt;br /&gt;
    --arg model &amp;quot;$MODEL&amp;quot; \&lt;br /&gt;
    --arg prompt &amp;quot;$PROMPT&amp;quot; \&lt;br /&gt;
    --argjson max_tokens &amp;quot;$MAX_TOKENS&amp;quot; &amp;#039;{&lt;br /&gt;
      model: $model,&lt;br /&gt;
      messages: [&lt;br /&gt;
        {&lt;br /&gt;
          role: &amp;quot;user&amp;quot;,&lt;br /&gt;
          content: $prompt&lt;br /&gt;
        }&lt;br /&gt;
      ],&lt;br /&gt;
      stream: true,&lt;br /&gt;
      stream_options: {include_usage: true},&lt;br /&gt;
      max_tokens: $max_tokens&lt;br /&gt;
    }&amp;#039; |&lt;br /&gt;
  curl --fail-with-body --no-buffer -sS \&lt;br /&gt;
    --connect-timeout 5 \&lt;br /&gt;
    --max-time 180 \&lt;br /&gt;
    https://llm.stoney-cloud.com/v1/chat/completions \&lt;br /&gt;
    -H &amp;quot;Authorization: Bearer ${STONEY_KEY:?Set your production STONEY_KEY}&amp;quot; \&lt;br /&gt;
    -H &amp;#039;Content-Type: application/json&amp;#039; \&lt;br /&gt;
    --data-binary @- |&lt;br /&gt;
  tee &amp;quot;$STREAM_FILE&amp;quot; |&lt;br /&gt;
  python3 -u -c &amp;#039;&lt;br /&gt;
import json&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
section = None&lt;br /&gt;
latest_usage = None&lt;br /&gt;
done = False&lt;br /&gt;
&lt;br /&gt;
for line in sys.stdin:&lt;br /&gt;
    if not line.startswith(&amp;quot;data:&amp;quot;):&lt;br /&gt;
        continue&lt;br /&gt;
&lt;br /&gt;
    payload = line[5:].strip()&lt;br /&gt;
    if payload == &amp;quot;[DONE]&amp;quot;:&lt;br /&gt;
        done = True&lt;br /&gt;
        continue&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        event = json.loads(payload)&lt;br /&gt;
    except json.JSONDecodeError:&lt;br /&gt;
        continue&lt;br /&gt;
&lt;br /&gt;
    if not isinstance(event, dict):&lt;br /&gt;
        continue&lt;br /&gt;
&lt;br /&gt;
    if &amp;quot;error&amp;quot; in event:&lt;br /&gt;
        print(&amp;quot;\nAPI error:&amp;quot;, event[&amp;quot;error&amp;quot;], flush=True)&lt;br /&gt;
&lt;br /&gt;
    for choice in event.get(&amp;quot;choices&amp;quot;) or []:&lt;br /&gt;
        delta = choice.get(&amp;quot;delta&amp;quot;) or {}&lt;br /&gt;
        reasoning = delta.get(&amp;quot;reasoning&amp;quot;) or delta.get(&amp;quot;reasoning_content&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        for label, text in (&lt;br /&gt;
            (&amp;quot;Reasoning&amp;quot;, reasoning),&lt;br /&gt;
            (&amp;quot;Answer&amp;quot;, delta.get(&amp;quot;content&amp;quot;)),&lt;br /&gt;
        ):&lt;br /&gt;
            if isinstance(text, str) and text:&lt;br /&gt;
                if section != label:&lt;br /&gt;
                    print(&amp;quot;\n\n--- {} ---&amp;quot;.format(label), flush=True)&lt;br /&gt;
                    section = label&lt;br /&gt;
                print(text, end=&amp;quot;&amp;quot;, flush=True)&lt;br /&gt;
&lt;br /&gt;
        if choice.get(&amp;quot;finish_reason&amp;quot;):&lt;br /&gt;
            print(&lt;br /&gt;
                &amp;quot;\n[Finish reason: {}]&amp;quot;.format(choice[&amp;quot;finish_reason&amp;quot;]),&lt;br /&gt;
                flush=True,&lt;br /&gt;
            )&lt;br /&gt;
&lt;br /&gt;
    usage = event.get(&amp;quot;usage&amp;quot;)&lt;br /&gt;
    if isinstance(usage, dict):&lt;br /&gt;
        latest_usage = usage&lt;br /&gt;
&lt;br /&gt;
if latest_usage is not None:&lt;br /&gt;
    label = &amp;quot;Usage&amp;quot; if done else &amp;quot;Last reported usage (stream incomplete)&amp;quot;&lt;br /&gt;
    print(&amp;quot;\n\n{}:\n{}&amp;quot;.format(&lt;br /&gt;
        label, json.dumps(latest_usage, indent=2)&lt;br /&gt;
    ), flush=True)&lt;br /&gt;
&lt;br /&gt;
print(&lt;br /&gt;
    &amp;quot;\n[Stream complete]&amp;quot; if done else &amp;quot;\n[Stream ended without DONE]&amp;quot;,&lt;br /&gt;
    flush=True,&lt;br /&gt;
)&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: AI on Demand]]&lt;/div&gt;</summary>
		<author><name>Sst-djo</name></author>
	</entry>
</feed>