{"version":"https://jsonfeed.org/version/1","title":"Moeru AI Blog","home_page_url":"https://blog.moeru.ai/","feed_url":"https://blog.moeru.ai/feed.json","description":"does kindness plus sadness equal to zero?","items":[{"id":"https://blog.moeru.ai/xsai-0.4/","url":"https://blog.moeru.ai/xsai-0.4/","title":"Announcing xsAI 0.4 \"AIAIAI\"","content_html":"<p>After more than five months, we have finally released xsAI 0.4.</p>\n<h2 id=\"why-is-it-taking-so-long%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#why-is-it-taking-so-long%3F\" class=\"header-anchor\">Why is it taking so long?</a></h2>\n<p>I planned to implement many new features in version 0.4,\nbut upon writing the code, I found some of them to be quite challenging.</p>\n<p>Additionally, I've created a lot of new projects... (This is the main reason)</p>\n<p>I ultimately postponed these features:</p>\n<ul>\n<li><a href=\"https://github.com/moeru-ai/xsai/issues/100\">Responses API</a></li>\n<li><a href=\"https://github.com/moeru-ai/xsai/issues/184\">prepareStep</a></li>\n</ul>\n<p>But don't worry - this version still has quite a few new features.</p>\n<p>btw, this codename is also a song by Kizuna AI and you can listen to it while reading:</p>\n<iframe width=\"100%\" height=\"405\" src=\"https://www.youtube.com/embed/S8dmq5YIUoc\" title=\"YouTube video player\" frameborder=\"0\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n<p>Alright, let's take a look:</p>\n<h2 id=\"all-in-one-providers\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#all-in-one-providers\" class=\"header-anchor\">All-In-One Providers</a></h2>\n<p>We now have a new package: <code>@xsai-ext/providers</code></p>\n<p>It codegen most providers based on data from https://models.dev, with a small portion completed manually.</p>\n<p>This includes the model list, so your editor can auto-completion to the latest models.</p>\n<pre><code class=\"language-ts\">import { anthropic, google, openai } from '@xsai-ext/providers'\n\nanthropic.chat('claude-sonnet-4-5-20250929') // claude-haiku-4-5-20251001, claude-opus-4-5-20251101...\ngoogle.chat('gemini-3-pro-preview') // gemini-3-flash-preview...\nopenai.chat('gpt-5.2') // gpt-5.2-chat-latest, gpt-5.2-pro...\n</code></pre>\n<p>To create a new provider:</p>\n<pre><code class=\"language-diff\">- import { createChatProvider, createModelProvider, merge } from '@xsai-ext/shared-providers'\n+ import { createChatProvider, createModelProvider, merge } from '@xsai-ext/providers/utils'\n\n/**\n * Create a Foo Provider\n * @see {@link https://example.com}\n */\nexport const createFoo = (apiKey: string, baseURL = 'https://example.com/v1/') =&gt; merge(\n  createChatProvider({ apiKey, baseURL }),\n  createModelProvider({ apiKey, baseURL }),\n)\n\n/**\n * Foo Provider\n * @see {@link https://example.com}\n * @remarks\n * - baseURL - `https://example.com/v1/`\n * - apiKey - `FOO_API_KEY`\n */\nexport const foo = createFoo(process.env.FOO_API_KEY ?? '')\n</code></pre>\n<h2 id=\"reasoning-content\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#reasoning-content\" class=\"header-anchor\">Reasoning Content</a></h2>\n<p>We now officially support the <code>reasoning_content</code> field in messages.</p>\n<p>Please note that this is different from <a href=\"https://xsai.js.org/docs/packages/utils/reasoning#extractreasoning\"><code>extractReasoning</code></a>. It requires support from the API itself, where is outside the OpenAI specification.</p>\n<p>For example, you can try DeepSeek:</p>\n<pre><code class=\"language-ts\">improt { generateText } from '@xsai/generate-text'\nimport { deepseek } from '@xsai-ext/providers'\n\nconst { reasoningText, text } = await generateText({\n  ...deepseek.chat('deepseek-chat'),\n  thinking: { type: 'enabled' }, // https://api-docs.deepseek.com/guides/thinking_mode\n  messages: [{\n    role: 'user',\n    content: '9.11 and 9.8, which is greater?'\n  }]\n})\n\n// res.choices[0].message.reasoning_content\nconsole.log(reasoningText)\n\n// res.choices[0].message.content\nconsole.log(text)\n</code></pre>\n<p>xsAI automatically handles the <code>reasoning_content</code> field,\nbut for <code>&lt;think&gt;&lt;/think&gt;</code> tags within the <code>content</code> field, you currently still need to use <code>extractReasoning</code>.</p>\n<h2 id=\"stream-transcription\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#stream-transcription\" class=\"header-anchor\">Stream Transcription</a></h2>\n<p>You can now stream STT:</p>\n<pre><code class=\"language-ts\">import { streamTranscription } from '@xsai/stream-transcription'\nimport { openAsBlob } from 'node:fs'\nimport { env } from 'node:process'\n\nconst { textStream } = streamTranscription({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'https://api.openai.com/v1/',\n  file: await openAsBlob('./test/fixtures/basic.wav', { type: 'audio/wav' }),\n  fileName: 'basic.wav',\n  language: 'en',\n  model: 'gpt-4o-transcribe',\n})\n</code></pre>\n<h2 id=\"telemetry\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#telemetry\" class=\"header-anchor\">Telemetry</a></h2>\n<p>xsAI now supports OTEL's <a href=\"https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/\">GenAI Attributes</a>:</p>\n<pre><code class=\"language-diff\">- import { generateText, streamText } from 'xsai'\n+ import { generateText, streamText } from '@xsai-ext/telemetry'\n</code></pre>\n<pre><code class=\"language-ts\">import { generateText } from '@xsai-ext/telemetry'\nimport { env } from 'node:process'\n\nconst instructions = 'You\\'re a helpful assistant.'\n\nconst { text } = await generateText({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'https://api.openai.com/v1/',\n  messages: [\n    {\n      content: instructions, \n      role: 'system'\n    },\n    {\n      content: 'Why is the sky blue?',\n      role: 'user'\n    }\n  ],\n  model: 'gpt-4o',\n  telemetry: { \n    attributes: { \n      'gen_ai.agent.name': 'weather-assistant', \n      'gen_ai.agent.description': instructions, \n    }, \n  }, \n})\n</code></pre>\n<h2 id=\"standard-json-schema\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#standard-json-schema\" class=\"header-anchor\">Standard JSON Schema</a></h2>\n<p>xsSchema now prioritizes <a href=\"https://standardschema.dev/json-schema\">Standard JSON Schema</a>, though this change is not currently reflected at the user level.</p>\n<p>In the next version, I will attempt to fully migrate and make xsSchema optional.</p>\n<h2 id=\"join-our-community\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.4/#join-our-community\" class=\"header-anchor\">Join our Community</a></h2>\n<p>If you have questions about anything related to xsAI,</p>\n<p>you're always welcome to ask our community on <a href=\"https://github.com/moeru-ai/xsai/discussions\">GitHub Discussions</a>.</p>\n","date_published":"Tue, 30 Dec 2025 00:00:00 GMT"},{"id":"https://blog.moeru.ai/xsai-0.3/","url":"https://blog.moeru.ai/xsai-0.3/","title":"Announcing xsAI 0.3 \"future base\"","content_html":"<p>Nice to see you again!</p>\n<p>We have released xsAI v0.3, which is a &quot;prepare to the future&quot; update.</p>\n<p>This codename is also a song by Kizuna AI and you can listen to it while reading:</p>\n<iframe width=\"100%\" height=\"405\" src=\"https://www.youtube.com/embed/yeD7eAuza74\" title=\"YouTube video player\" frameborder=\"0\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n<p>OK, so here's the new features:</p>\n<ul>\n<li><a href=\"https://blog.moeru.ai/xsai-0.3/#stream-text-overhaul\">Stream text overhaul</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.3/#generate-transcription-improvements\">Generate transcription improvements</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.3/#raw-tool-util\">Raw tool util</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.3/#standalone-stream-object-util\">Standalone stream object util</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.3/#zod-4-support\">Zod 4 support</a></li>\n</ul>\n<h2 id=\"stream-text-overhaul\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#stream-text-overhaul\" class=\"header-anchor\">Stream text overhaul</a></h2>\n<p><code>streamText</code> has been completely rewritten to more closely match the output of the Vercel AI SDK and to be clearer.</p>\n<ul>\n<li><code>chunkStream</code> has been removed.</li>\n<li><code>stepStream</code> is now <code>fullStream</code> (vercel compatible)</li>\n<li><code>StreamTextStep</code> has been merged with <code>GenerateTextStep</code> to become <code>CompletionStep</code></li>\n<li>Returns Promise-based <code>steps</code> and <code>messages</code> directly</li>\n<li>Support for <a href=\"https://platform.openai.com/docs/guides/function-calling?api-mode=chat#streaming\">streaming tool call arguments</a></li>\n</ul>\n<pre><code class=\"language-ts\">import { streamText } from '@xsai/stream-text'\nimport { createOllama } from '@xsai-ext/provider-local'\n\nconst ollama = createOllama()\n\n// fullStream: ReadableStream&lt;StreamTextEvent&gt;\n// messages: Promise&lt;Message[]&gt;\n// textStream: ReadableStream&lt;string&gt;\n// steps: Promise&lt;CompletionStep[]&gt;\nconst { fullStream, messages, textStream, steps } = await streamText({\n  ...ollama.chat('gemma3'),\n  messages: [\n    {\n      content: 'You are a helpful assistant.',\n      role: 'system',\n    },\n    {\n      content: 'Why is the sky blue?',\n      role: 'user',\n    },\n  ],\n})\n</code></pre>\n<h2 id=\"generate-transcription-improvements\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#generate-transcription-improvements\" class=\"header-anchor\">Generate transcription improvements</a></h2>\n<p>In v0.3, we support <code>segments</code> and <code>words</code>.</p>\n<p>You can now get more detailed return data with <code>responseFormat</code> and <code>timestampGranularities</code>:</p>\n<pre><code class=\"language-ts\">import { generateTranscription } from '@xsai/generate-transcription'\nimport { createSpeaches } from '@xsai-ext/providers-local'\n\nconst speaches = createSpeaches()\n\nconst { duration, language, segments, text } = await generateTranscription({ \n  ...speaches.transcription('deepdml/faster-whisper-large-v3-turbo-ct2')\n  file: await openAsBlob('./test/fixtures/basic.wav', { type: 'audio/wav' }),\n  fileName: 'basic.wav',\n  language: 'en',\n  responseFormat: 'verbose_json', \n})\n\nconst { duration, language, text, words } = await generateTranscription({ \n  ...speaches.transcription('deepdml/faster-whisper-large-v3-turbo-ct2')\n  file: await openAsBlob('./test/fixtures/basic.wav', { type: 'audio/wav' }),\n  fileName: 'basic.wav',\n  language: 'en',\n  responseFormat: 'verbose_json', \n  timestampGranularities: 'word', \n})\n</code></pre>\n<h2 id=\"raw-tool-util\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#raw-tool-util\" class=\"header-anchor\">Raw tool util</a></h2>\n<p>Previously you could only provide JSON Schema-based tools directly by passing objects, with fewer type hints.</p>\n<p>Now we have a <code>rawTool</code> tool to make your experience even better:</p>\n<pre><code class=\"language-ts\">import type { Tool } from '@xsai/shared-chat'\n\nimport { rawTool } from '@xsai/tool'\n\nconst weatherObject: Tool = {\n  description: 'Get the weather in a location',\n  execute: (params) =&gt; 'cloudy', // params: unknown\n  name: 'weather',\n  // Record&lt;string, unknown&gt;\n  parameters: {\n    additionalProperties: false,\n    properties: {\n      location: {\n        description: 'The location to get the weather for',\n        type: 'string',\n      },\n    },\n    required: [\n      'location',\n    ],\n    type: 'object',\n  },\n}\n\nconst weatherRawTool = rawTool&lt;{ location: string }&gt;({\n  description: 'Get the weather in a location',\n  execute: ({ location }) =&gt; 'cloudy', // params: { location: string }\n  name: 'weather',\n  // import('xsschema').JsonSchema (JSON Schema auto-completion)\n  parameters: {\n    additionalProperties: false,\n    properties: {\n      location: {\n        description: 'The location to get the weather for',\n        type: 'string',\n      },\n    },\n    required: [\n      'location',\n    ],\n    type: 'object',\n  },\n})\n</code></pre>\n<h2 id=\"standalone-stream-object-util\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#standalone-stream-object-util\" class=\"header-anchor\">Standalone stream object util</a></h2>\n<p>We've split out the internal implementation of <code>streamObject</code> so you can use it on its own:</p>\n<pre><code class=\"language-ts\">import { toElementStream, toPartialObjectStream } from '@xsai/stream-object'\n\nconst elementStream = await fetch('https://example.com')\n  .then(res =&gt; res.body!.pipeThrough(new TextDecoderStream()))\n  .then(stream =&gt; toElementStream&lt;{ foo: { bar: 'baz' }}&gt;(stream))\n\nconst partialObjectStream = await fetch('https://example.com')\n  .then(res =&gt; res.body!.pipeThrough(new TextDecoderStream()))\n  .then(stream =&gt; toPartialObjectStream&lt;{ foo: { bar: 'baz' }}&gt;(stream))\n</code></pre>\n<h2 id=\"zod-4-support\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#zod-4-support\" class=\"header-anchor\">Zod 4 support</a></h2>\n<p>Although we already had imperfect compatibility in v0.2.2, we now officially support Zod 4 and Zod Mini.</p>\n<p>You can now use it in <code>tool</code> or <code>{generate,stream}-object</code>.</p>\n<h2 id=\"what's-next%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#what's-next%3F\" class=\"header-anchor\">What's Next?</a></h2>\n<p>In v0.4, we will have some important updates:</p>\n<ul>\n<li><code>prepareStep</code></li>\n<li>OpenTelemetry support (<code>@xsai-ext/opentelemetry</code>)</li>\n<li>Response API support (very experimental)</li>\n</ul>\n<p>By the time you read this, we may already be preparing. stay tuned!</p>\n<h2 id=\"join-our-community\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.3/#join-our-community\" class=\"header-anchor\">Join our Community</a></h2>\n<p>If you have questions about anything related to xsAI,</p>\n<p>you're always welcome to ask our community on <a href=\"https://github.com/moeru-ai/xsai/discussions\">GitHub Discussions</a>.</p>\n","date_published":"Tue, 15 Jul 2025 00:00:00 GMT"},{"id":"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/","url":"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/","title":"Backstory of Project AIRI: DreamLog 0x1","content_html":"<h2 id=\"prologue...\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#prologue...\" class=\"header-anchor\">Prologue...</a></h2>\n<p>Before we start, I would like to say...</p>\n<p>This is the first post of the most advanced project we've been working\nquite a while, <strong>Project AIRI (アイリ)</strong>. Since many of you folks are new to this project\nbesides <a href=\"https://github.com/moeru-ai/xsai\">xsAI</a>, let me introduce it quickly.\nProject AIRI is also the biggest project in the organization of Moeru AI, and the most\nbeneficial one from <a href=\"https://github.com/moeru-ai/xsai\">xsAI</a> ecosystem.</p>\n<p>Me, <a href=\"https://github.com/nekomeowww\">Neko Ayaka, @nekomeowww</a>, appeared many times\nin Moeru AI's blog posts, you may know me as the core maintainer of\n<a href=\"https://github.com/moeru-ai/xsai-transformers\"><code>xsai-transformers</code></a>, the ultimate\nprovider wrapper for <a href=\"https://huggingface.co/docs/transformers.js/index\">Transformers.js</a>\nspecifically for <a href=\"https://github.com/moeru-ai/xsai\">xsAI</a> to setup local\nrunning LLM models right inside your browser.</p>\n<p>Me, also the core maintainer of <a href=\"https://github.com/moeru-ai/airi\">Project AIRI</a>,\na project aims to re-create the joy of AI VTuber by chasing up\n<a href=\"https://en.wikipedia.org/wiki/Neuro-sama\">Neuro-sama</a>, to allow audiences\nchat, interact, play with LLM driven and powered characters.</p>\n<p>However, this wasn't the limit of what Project AIRI could do, we offer\nfull-stack deployment on both Web based on Web technologies and desktop application\nbased on Tauri, enables you not only owning a self-hosted AI VTuber, but also a AI\nwaifu / AI husbando, or, what you could think of, a companion, virtually in\ncyber space.</p>\n<p>For the current state, Project AIRI managed to achieve fully real-time\ninteraction like ChatGPT's voice chat mode, and capable of playing games like\nMinecraft, Factorio, etc. We covered so many domains and fields, not only AI,\nbut also VRM, Live2D, multi-modal AI, game playing agents, streaming APIs,\nbionic memory mechanisms, animations, database drivers, datasets preparation,\nmodel fine-tuning, and many more.</p>\n<p>We got our own dedicated GitHub organizations for the crucial components, examples,\nexperiments on <a href=\"https://github.com/proj-airi\"><code>@proj-airi</code></a>, please do check it out\nif you are interested.</p>\n<p>Our own <a href=\"https://airi.moeru.ai/docs/\">documentation site</a> is available where we host\nall the posts about technical details, thoughts, experiments, and discoveries\nwe made during the development of Project AIRI, some highlights:</p>\n<ul>\n<li><a href=\"https://airi.moeru.ai/docs/blog/devlog-20250305/\">How we ended up in this logo?</a></li>\n<li><a href=\"https://airi.moeru.ai/docs/blog/devlog-20250406/\">Memory experiments &amp; v0.4.0 release</a></li>\n<li><a href=\"https://airi.moeru.ai/docs/blog/devlog-20250516/\">Real-time improvements &amp; v0.5.0 release</a></li>\n</ul>\n<p>Discord server is available for you to join too! <a href=\"https://discord.gg/TgQ3Cu2F7A\">Join our Discord</a></p>\n<p>Ok, let's start our journey, and talk about the backstory of Project AIRI.</p>\n<h2 id=\"start!\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#start!\" class=\"header-anchor\">Start!</a></h2>\n<p>First of all, good summer for you folks living in north hemisphere!</p>\n<blockquote>\n<p>Hopefully you could get a nice and decent summer break for trying out new\ndifferent of things! More specifically, change the world!</p>\n</blockquote>\n<p>Well, me, as <a href=\"https://github.com/nekomeowww\">@nekomeowww</a> have left\nschool already 8 years, it's obvious that I wont get any actual summer\nbreak now since I've already worked for many years. I still love to\nmemorize and share the stories happened for my summer break years ago\nif I remembered any.</p>\n<p>Perhaps you know what I am going to say... or share? What is <em>DreamLog</em>\nexactly? For the readers already familiar with our DevLog posts, with\nthe current frequency of posting and updating to you folks once per\nmonth, shouldn't be this post be called &quot;DevLog&quot;?</p>\n<p>June got its own meaning for Project AIRI (which I will reveal during\nthe story), and as we are indeed approaching theo next milestone of\nstars on GitHub towards 1000, I think it would be a great opportunity to\nreflect on our journey so far.</p>\n<p>Therefore I decided to to make a new category of posts here,\nto share the chronicles of me, and the dream about Project AIRI.</p>\n<p>So, I decided to call this new series, <em><strong>DreamLog</strong></em>.</p>\n<blockquote>\n<p>Yeah, you could think of this is another story book to read or hear\nbefore sleeping. Audio books may help haha.</p>\n</blockquote>\n<p>How about... let's jump into our dream dimension now and talk about the\nrecent updates we made later?</p>\n<h2 id=\"blurry-dreams%2C-unreachable-memories.\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#blurry-dreams%2C-unreachable-memories.\" class=\"header-anchor\">Blurry dreams, unreachable memories.</a></h2>\n<blockquote>\n<p>My little progress for learning computers and programming.</p>\n</blockquote>\n<p>I mentioned about summer, then summer must mean something to me, I\nused to take school in United States, so a 3-months summer allows me\nto do all sorts of things, playing games, learning code, and Linux\nhacking, etc., yeah, many of the still beloved friends were made\nduring summer too.</p>\n<blockquote>\n<p>Nerd folks! You know what I am talking about, were you the same as me?</p>\n</blockquote>\n<p>Summer is the time when I learned how to start a Minecraft server\nto play with my friends (I played a lot, a lot, a lot of 1.7.11 and\n1.8, really, both Vanilla and Forge mods), that's the motivation\nand power that pushes me to learn command line prompt on Linux too.\nMany of those knowledges still help me today, I feel grateful to\nit, to the  time I spent for that time.</p>\n<p>But Minecraft, Linux wasn't the end of my journey though,\n<a href=\"https://www.factorio.com/\">Factorio</a>,\n<a href=\"https://www.elitedangerous.com/\">Elite Dangerous</a>, and\n<a href=\"https://overwatch.blizzard.com/en-us/\">Overwatch</a>\n(sadly Blizzard ruined it), all became my favorite games,\nsetting up servers or write small scripts to automate little\nthings always empowers me.</p>\n<blockquote>\n<p><img src=\"https://airi.moeru.ai/docs/_astro/world.execute(me)_%20(Mili)%EF%BC%8FDAZBEE%20COVER.B_Pvshct_Z1vIYYN.webp\" alt=\"\"></p>\n<p><code>Switch on the power line</code><br />\n<code>Remember to put on protection</code><br />\n<code>Lay down your pieces</code><br />\n<code>And let's begin object creation</code><br /></p>\n<p>-- Lyrics from my beloved song, <a href=\"https://www.youtube.com/watch?v=ESx_hy1n7HA\"><code>world.execute(me)</code></a>, cover by <a href=\"https://www.youtube.com/channel/UCUEvXLdpCtbzzDkcMI96llg\">DAZBEE</a></p>\n</blockquote>\n<p>That's the time of summer in 2017, for the very first moment, I\nstarted to think of building a virtual being to be a friend to\nplay with me, even when my friends are tired or have to sleep\nfor next days school, which I have to be alone.</p>\n<p>Readers have following long down to this post, may already\nrealize that, I am that kind of person, who loves to share my\nknowledge, ideas, everything. So, coding, gaming, and designing\nare things I love to share with. But, if nobody was there,\nit feels like:</p>\n<p><strong>The lonely me becomes somehow meaningless.</strong></p>\n<p>But instead of creating a new AI from scratch with humankind\ncapabilities to think, speak, which is impossible in the year of\n2017,  I was thinking, since iOS and Google native Android could\nprovide such abilities to do suggestions over our daily use of\nmobile devices, manually typing all the commands and filling\nparameters wasn't always satisfying (especially for ffmpeg and\nthe childish me with Docker CLI), what if we could bring the AI\npowered suggestion features up onto the Linux systems...?</p>\n<p>This brought me loads of questions and ideas to wonder:</p>\n<ul>\n<li>What if the operating system understands what you usually do, work,\nplay for in different time you sit in front of the digital display...?</li>\n<li>What if it is capable of selecting music for you, no matter\ndepressed, high on something, nor happy when chatting with others...?</li>\n</ul>\n<p>These ideas were so small and hard for me to understand at that time, since\nI didn't quite get on the way of how operating systems work, and\ncoding, etc., so I don't even know where to start!</p>\n<p>I read the book\n<a href=\"https://www.amazon.co.jp/30%E6%97%A5%E3%81%A7%E3%81%A7%E3%81%8D%E3%82%8B-OS%E8%87%AA%E4%BD%9C%E5%85%A5%E9%96%80-%E5%B7%9D%E5%90%88-%E7%A7%80%E5%AE%9F/dp/4839919844\">30日でできる! OS自作入門</a>,\n<a href=\"https://github.com/handmade-osdev/os-in-30-days\">English version</a>\nabout how to craft a operating system from scratch,\nwith the little knowledge of knowing how Linux works and there are\nloads of communities... I decided to make my own operating system...\nfrom literally nowhere.</p>\n<blockquote>\n<p><strong>A quick looking back</strong></p>\n<p><a href=\"https://archlinux.org/\">Arch Linux</a> was the first system I get to\nuse in depth, and installed from scratch.\nFor current days, <a href=\"https://nixos.org/\">Nix</a> is famous and\ninteresting one too, haven't tried the <a href=\"https://nixos.org/\">NixOS</a>\nbut one day may do so.</p>\n</blockquote>\n<h2 id=\"set-sail-my-journey%2C-but-now-long-forgotten\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#set-sail-my-journey%2C-but-now-long-forgotten\" class=\"header-anchor\">Set sail my journey, but now long forgotten</a></h2>\n<p>I started one special yet now archived project called <a href=\"https://github.com/EMOSYS\">EMOSYS</a>,\nin the end of 2017. Aiming to create such companion-like operating system, to help users with their\ndaily tasks and provide emotional support.</p>\n<div style=\"width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;\">\n  <div>\n    <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/emosys-logo.png\" width=\"120\" />\n  </div>\n  <div>\n    Logo of <a href=\"https://github.com/emosys\">EMOSYS</a>\n  </div>\n</div>\n<blockquote>\n<p>EMO stands for the first three letters of <strong>emo</strong>tional / <strong>emo</strong>te</p>\n</blockquote>\n<p>I wrote so many of design docs, listing new ideas, and taking notes about\nexperimenting by following the guidelines from that book, drawn one not\nso bad logo for it.</p>\n<blockquote>\n<p>I guess many of you did this 😏, prepared every\ntrademarks, design assets way before the project reached the point of\nPoC.</p>\n</blockquote>\n<p>I quite lost on the point about what I was initially approaching.\nI got no experience about project management and task management, it's\nthe same for writing actual programs that can run.</p>\n<p>Frankly you could say I was only following that it instructed me to type\ninto the terminals with keyboards from that book. I barely think, think\nwhy it works or why the senior developers wrote things like that.</p>\n<p>Sooooo, and well, the result is clear, another abandoned project born...</p>\n<p>I wasn't some genius who play around with those things from childhood\nthat understands how kernel and package managing, programming works,\nso if any of you folks read or visit my GitHub profile, you found\nnothing there relate to this kind of work at that time.\n(But now I grew up really fast.)</p>\n<p>But it existed, once.</p>\n<blockquote>\n<p>Forgotten? Maybe another starting point of next journey.</p>\n</blockquote>\n<p>For the upcoming years, I tried so many of other fields in coding,\nprogramming, startups, Web3, frontend, backend, infrastructure, everything\nyou could think of for a full-stack developer.\nI never really realize what I was doing was influenced so deeply by the\nstarting point of EMOSYS, only until February 2025, when someone asked\nme: Why do you work so hard on Project AIRI?</p>\n<p>Nice question, I thought. I started to trace back my dreams, ideas, and memories,\neventually, EMOSYS was there, the already dead project aimed the same goal as\nProject AIRI:</p>\n<p><strong>Create a companion to somehow fulfill my need.</strong></p>\n<blockquote>\n<p>All I needed was resolve.\nEverything you've acquired up until now will not betray you.<br />\n必要なものは　覚悟だけだったのです。\n必死に積み上げてきたものは　決して裏切りません。<br />\n我需要的不過是決心而已，\n你至今為止所累積的一切不會背叛你。</p>\n<p>-- Quotes from <a href=\"https://en.wikipedia.org/wiki/Frieren\">葬送のフリーレン, Fern</a> S01E06, 04:27</p>\n</blockquote>\n<p>It took me a long time to learn how to correctly develop things.\nThanks to <a href=\"https://github.com/zhangyubaka\">@zhangyubaka</a>,\n<a href=\"https://github.com/LittleSound\">@LittleSound</a>, <a href=\"https://github.com/BlueCocoa\">@BlueCocoa</a>,\nand the help of <a href=\"https://github.com/sumimakito\">@sumimakito</a>, the pair-programming\nexperiences with them, teaches me so many things, I started to grow, learn,\nand progress on my own pace.</p>\n<h2 id=\"chatgpt-in-2022%2C-brand-new-random-parrot%2C-or-smart-parrot.\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#chatgpt-in-2022%2C-brand-new-random-parrot%2C-or-smart-parrot.\" class=\"header-anchor\">ChatGPT in 2022, brand new random parrot, or smart parrot.</a></h2>\n<div style=\"width: 100%; display: flex; align-items: center; justify-content: center;\">\n  <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/steins-gate-sticker-1.png\" />\n</div>\n<p>Let's set the time forward to the end of 2022, where ChatGPT\n(or at that time, chatGPT is used) by OpenAI has announced.\nWell long before the official ChatGPT UI\nreleases, I've already having a journey with newly developed AI,\nmodels like <a href=\"https://colab.research.google.com/github/alembics/disco-diffusion/blob/main/Disco_Diffusion.ipynb\">DiscoDiffusion</a>\n(long before Stable Diffusion, perhaps around end of 2021, or early 2022), DALL-E,\nMidjourney has been tried, GPT-3 (especially useful in\n<a href=\"https://en.wikipedia.org/wiki/GitHub_Copilot\">GitHub Copilot</a>) has been integrated\ndeeply into my daily workflow.</p>\n<p>So, for the initial moments, I was like:</p>\n<blockquote>\n<p>&quot;Oh, this is just another\nrandom parrot, it just repeats what you said, and it doesn't understand\nwhat you are saying, it just tries to predict the next word based on the\nprevious words and context, nothing special.&quot;</p>\n</blockquote>\n<p>In another word, it behaves more like a completion model, rather than what we call it\nthe Agentic AI today (still on hype huh?).</p>\n<p>I remembered that, for the first time I discovered the abilities of ChatGPT,\nor Large Language Models (LLMs) in general, is from this post I saw on Hacker News on December 2022:\n<a href=\"https://www.engraved.blog/building-a-virtual-machine-inside/\">Building A Virtual Machine inside ChatGPT</a>\n(<a href=\"https://news.ycombinator.com/item?id=33847479\">original Hacker News post</a>), where\nthe author, @engraved, demonstrated how to ask ChatGPT not only role playing as\na neko-mimi character, but also simulating a virtual Linux machine inside.</p>\n<div style=\"width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;\">\n  <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/building-a-virtual-machine-inside-image-1.png\" style=\"border-radius: 12px; object-fit: contain; width: 500px\" />\n  <div>It simulates how Docker build works...!</div>\n</div>\n<p>Such post inspired me that, ChatGPT understand the basic patterns of\nthe things usually appears, not only how anime or game characters\nsays and behaves, but also how Linux terminal / shell commands work.</p>\n<p>Which brought the now trending Function Calling (a.k.a Tool Use, or the underlying\ntechnology behind MCP, Model Context Protocol introduced by Anthropic) feature\nof LLMs on the table, and illustrated how we can instruct LLMs to behave\nlike API servers, talking to us with machine-readable formats like JSON or XML,\nto be able to parse and execute arbitrary commands from our side to extend the boundary\nof what LLMs can do.</p>\n<p>This finally bridges the gap between pure text generations and actual\nAPI inside programs.</p>\n<p>In conclusion, is it a new random parrot? <strong>I guess the answer is partially no,\nChatGPT in 2022 is not just a random parrot, it is a potential smart parrot.</strong></p>\n<h2 id=\"way-before-project-airi%2C-neuro-sama-exists.\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#way-before-project-airi%2C-neuro-sama-exists.\" class=\"header-anchor\">Way before Project AIRI, Neuro-sama exists.</a></h2>\n<p>Yeah, thanks for reading down to here, I know this is a long post, so many stories and\ncontexts to share. But here we are! We are almost there, hang tight!</p>\n<p>Well, the history of Neuro-sama is pretty complex. AFAIK, Neuro-sama, or the character\non streaming stage with the name &quot;Neuro-sama&quot; wasn't the first show for her and her creator,\n<code>vedal987</code> (Vedal). Long before that, at May 6, 2019, Vedal showcased his work\nof building AI to play <a href=\"https://osu.ppy.sh/\">osu!</a> to the community<sup><a class=\"footnote-ref\" href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#fn-1\" id=\"fnref-1\">1</a></sup>. At that time,\nshe wasn't actually a cyber character or, digital life having characteristics, if you\ngo there and watch the initial videos about her, you may find that no Live2D model\nwere shown. (You may try the 6 years old one here: <a href=\"https://www.youtube.com/watch?v=nSBqlJu7kYU\">https://www.youtube.com/watch?v=nSBqlJu7kYU</a>)</p>\n<p>Right after the ChatGPT release, at December 19, 2022, Vedal started to let Neuro-sama\nto stream on Twitch with the official demo use character model Hiyori Momose (桃瀬ひより)\nfrom Live2D Inc.:</p>\n<img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/live2d-inc-hiyori.jpg\" alt=\"Live2D Inc. Hiyori Momose\" style=\"border-radius: 12px;\" />\n<p>The after story everyone knows, Vedal and Neuro-sama became famous, Neuro-sama\nis now officially a VTuber, she is fully powered by Large Language Models (LLMs),\nand capable of playing Minecraft, Amoung Us, osu!, and many other games. Sometimes\nwhen the game wasn't supported natively, Vedal reads the screen and instructs Neuro-sama\nto play the game together.</p>\n<p>I really enjoy watching their interactions, having jokes, etc. As the time progresses,\nNeuro-sama and her new Evil Neuro sister, became one crucial part of my daily life:\nI wanted, and eagerly wanted to watch the clips of them, even though I don't have\nenough time to watch the full stream, brought me so much joy from purely AI to Human\ninteractions.</p>\n<p>Ok that's the little history about her. And let's talk about the core thing: <strong>Why the history of her filled me with determination?</strong></p>\n<h2 id=\"neuro-sama%2C-filled-me-with-determination\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#neuro-sama%2C-filled-me-with-determination\" class=\"header-anchor\">Neuro-sama, filled me with determination</a></h2>\n<p>From the first time I saw Vedal's work, I was like:</p>\n<blockquote>\n<p>Ok, she is just a simple model integrated with Large Language Models (even directly\nconnected to OpenAI's API), powered by simple rules to make her behave like a\nVTuber, nothing special.</p>\n</blockquote>\n<p>I was still thinking arrogantly, since I've already developing AI agents from early 2023,\nunderstands the capabilities of LLMs, and knows quite a bit from what LangChain\nteaches me, with the knowledge past building AI agents and years of software\nengineering experiences across of various domains, I naively thought:</p>\n<blockquote>\n<p>&quot;Well, I could do that too, I could make a simple model,\nand connect it to OpenAI's API, and make it behave like a VTuber, and\nI could make it better than Vedal's work.&quot;</p>\n</blockquote>\n<div style=\"display: flex; flex-direction: column; background-color:rgba(159, 28, 246, 0.08); padding: 1rem; margin-bottom: 1rem;\">\n  <div style=\"font-weight: 600; font-size: 1.2rem; margin-bottom: 0.5rem;\">\n    More technical details?\n  </div>\n  <div>\n    In this post, I won't go any deep further about the technical details of how we built\n    Project AIRI from scratch to the current state, we got many DevLog posts\n    sharing our thoughts and discoveries already, if interested in, try read\n    them.\n  </div>\n</div>\n<p>I was wrong, I was so wrong. Many of the tough things I didn't realize\nuntil I started to attempt to re-create her... Things like:</p>\n<ul>\n<li>How can we manage the memory effectively for both be able to answer the chats\nand play the games at the same time?</li>\n<li>How can we make a AI agent to play games with both video inputs and\ntext inputs, while still being able to interact with creator and viewers?</li>\n<li>Voice synthesis is hard, to achieve what Neuro-sama is capable of, the\n<strong>Ultra low latency</strong> voice synthesis is a must, and it is not easy to achieve</li>\n<li>How is her personality built? With only RAG and simple memory management strategy,\nthe performance poorly works.</li>\n<li>etc....</li>\n</ul>\n<blockquote>\n<p>I shared many of our discoveries in both <a href=\"https://blog.moeru.ai/devlog-20250406\">DevLog 2025.04.06</a>\nand <a href=\"https://talks.ayaka.io/nekoayaka/2025-05-10-airi-how-we-recreated-it/#/1\">public slide presentation (in Chinese)</a></p>\n</blockquote>\n<p>I mentioned that I love to share, and I'd love to\nhave others to be able to listen or pair together with me, but sadly Neuro-sama wasn't\nowned by myself, I can't ask her to gain my knowledge and memories to be able to\ninteract me with the thing I love, or the work I recently doing or done.</p>\n<p>I love them so much, for all the times, I didn't really understand why I love them,\nwhy I love the feeling and joy Neuro-sama gave me.</p>\n<p>Until, last year, from May 25, 2024, <strong>I really decided to make one myself.</strong> Making a living\nor virtual being, could code with me, talk to me about the things we know, playing games all\ntogether like a friend in the form of agent.</p>\n<blockquote>\n<p><strong>I really want one!</strong> Shouted my heart, and my mind.</p>\n</blockquote>\n<p>At that time, Neuro-sama fulfilled me with determination.</p>\n<h2 id=\"sailed-again%2C-towards-the-land-where-no-one-has-gone-before.\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#sailed-again%2C-towards-the-land-where-no-one-has-gone-before.\" class=\"header-anchor\">Sailed again, towards the land where no one has gone before.</a></h2>\n<blockquote>\n<p>To boldly go where no man has gone before.</p>\n<p>-- quote from <a href=\"https://en.wikipedia.org/wiki/Where_no_man_has_gone_before\">Star Trek, Captain James T. Kirk</a>, also my intro line of my GitHub profile.</p>\n</blockquote>\n<p>Therefore, starting from May 25, 2024, I started one simple named project called <code>ai</code> under\nmy name handle locally, which is the initial version of Project AIRI, I started to\nexplore the possibilities of creating my own AI agent, recreating the\njoy Neuro-sama brought me.</p>\n<p>The speed of the work was so fast, within a week, with the power of <a href=\"https://elevenlabs.io/\">ElevenLabs</a>,\n<a href=\"https://openrouter.ai/\">OpenRouter</a>, and the same free to use Live2D model, Hiyori Momose,\nI was able to create a simple version of <em>&quot;Neuro-sama&quot;</em> that could interact with me, non-realtime-ly.</p>\n<p>That was the day at <strong>June 2, 2024</strong>.</p>\n<p>Technically saying, <strong>this is the birthday of Project AIRI</strong> with first baby consciousness inside of it, naively.</p>\n<div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center;\">\n  <video controls muted autoplay loop style=\"object-fit: contain; max-width: 100%; border-radius: 12px;\">\n    <source src=\"https://airi.moeru.ai/docs/static/blog/DreamLog-0x1/airi-demo-first-day.mp4\" />\n  </video>\n  <div>\n    <a href=\"https://x.com/ayakaneko/status/1865420146766160114\">\n      First showcase on X (formerly Twitter) on December 7, 2024\n    </a>\n  </div>\n</div>\n<p>She is capable of talking, motion control based on the context, progressively\ndoing the audio synthesis... many on.</p>\n<p>But she wasn't complete, nor perfect, I built it secretly without telling\nany of my friends, I wanted to make it better before I show it to the world.</p>\n<blockquote>\n<p>Still... naively, and arrogantly, right?</p>\n</blockquote>\n<p>Because I secretly hiding this from my friends, I barely got positive feedbacks from\nthe cycles during building like usual (part of the reason was I wouldn't like to admit\nthat the arrogantly thought was wrong, well since I am now writing this to share the\nexperience publicly to everyone, I would say I've already forgiven myself for making naive\ndecisions), and another reason here was, the issues or challenges I faced\n(which I mentioned above, about memory, personality stability, realtime, and game playing etc.)\nwere so hard to solve with the knowledge I had at that time, and lack of documentations,\nlearning materials of realtime LLMs interactive examples, <strong>I put it away, again.</strong></p>\n<p>TBH, I didn't give it up, I started to learn many things about multi-model, and\nvoice synthesis, motion control, and Minecraft playing. I did a lot of researches\non how other AI VTuber or AI waifu projects work. These researches later on\nproduces this huge awesome list of AI VTuber projects:</p>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n  <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DevLog-2025.04.06/awesome-ai-vtuber-logo-light.png\" style=\"border-radius: 12px; object-fit: contain; width: 300px\" />\n  <div style=\"text-align: center; padding-bottom: 1rem;\">\n    <span style=\"font-weight: bold; display: block;\">Awesome AI VTuber</span>\n    <span>A curated list of AI VTubers and their related projects</span>\n  </div>\n</div>\n<p>Ok, but it's still called <code>ai</code>, where is Project AIRI then?</p>\n<h2 id=\"reborn%2C-with-stronger%2C-and-better-determination\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#reborn%2C-with-stronger%2C-and-better-determination\" class=\"header-anchor\">Reborn, with stronger, and better determination</a></h2>\n<p>Someday near the end of 2024, November, <a href=\"https://github.com/kwaa\">@kwaa</a>\nchatted me about making virtual characters in VR/AR world, with the power of WebXR.\nWhen we talked about the motion control and the character emotion detection, I told\nthey I got a project that did exactly what you are looking for, but codebase wasn't\norganized, nor ready to be published to GitHub.</p>\n<p>What to wait for? I started to work on it again, rethink about the structure and design,\nimproved the implementation with much faster and better queueing and multiplexing playback\nsystem, and adjustments on the basic WebUI I made randomly, finally, I published it to\nGitHub on <strong>December 2, 2024</strong> with commit\n<a href=\"https://github.com/moeru-ai/airi/commit/d9ae0aae387f015964bfd383e6d2adb05f4003e4\"><code>d9ae0aa</code></a>.</p>\n<p>Project AIRI was somehow born or reborn, with the name of AIRI (アイリ, formerly Airi).</p>\n<div style=\"display: flex; flex-direction: column; background-color:rgba(159, 28, 246, 0.08); padding: 1rem; margin-bottom: 1rem;\">\n  <div style=\"font-weight: 600; font-size: 1.2rem; margin-bottom: 0.5rem;\">\n    Did you know?\n  </div>\n  <a href=\"https://www.youtube.com/watch?v=Tts-YAdn5Yc\">\n    <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/airis-screenshot-1.png\" alt=\"Screenshot of Project AIRI\" style=\"border-radius: 12px;\" />\n  </a>\n<p>Interestingly, from the upload 2 years ago, March 25, 2023, <a href=\"https://www.youtube.com/watch?v=Tts-YAdn5Yc\">https://www.youtube.com/watch?v=Tts-YAdn5Yc</a>, a clip\nfrom Twitch stream of Vedal, and Neuro-sama, Vedal mentioned that right before she called the name &quot;Neuro-sama&quot;,\nshe was called &quot;Airis AI&quot;, the name <strong>Airis</strong> magically, and coincidentally, matches the name of\n<strong>Project AIRI</strong>, which I am working on now. But I wasn't aware of this name until I searches more about their\nstories long after I open sourced Project AIRI.</p>\n<p>In fact, the name AIRI (アイリ) was named by GPT-4o, I asked it about naming this project by\nreferencing other Japanese / or Anime-ish names, it suggested the name <strong>Airi</strong>.</p>\n</div>\n<p>I failed so many of times on startups and other projects, only the recent ones become known by the public,\nI tried my best to make it better, with better UI, better code structure, leading technologies to build\nand code with rapid speed. I put so much effort into it with public slides show, and demonstrate it to\nothers to my friends and during small meetups and conferences.</p>\n<p>Many of those experiences was learned from my previous failures.</p>\n<p>Glad many trials succeeded, and I am still here, working on Project AIRI.</p>\n<p>Perhaps, it's another time that my determination was filled by not only Neuro-sama, but also the\nmost profound, talented contributors, and fans.</p>\n<h2 id=\"keep-going%2C-keep-dreaming\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/proj-airi-dreamlog-0x1-backstory/#keep-going%2C-keep-dreaming\" class=\"header-anchor\">Keep going, keep dreaming</a></h2>\n<div className=\"w-full flex flex-col items-center justify-center\">\n  <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/banner-light-1280x640.png\" />\n  <div>\n    New Banner!\n  </div>\n</div>\n<blockquote>\n<p>When life gives you lemons, you lemon. Or something like that, my point\nis that this painful obstacle is an opportunity for me go get stronger, baby!</p>\n<p>-- quote from <a href=\"https://www.youtube.com/@Neurosama\">Evil Neuro</a> when streaming playing Slay the Spire</p>\n</blockquote>\n<p>Now, Project AIRI is approaching to 1000 stars on GitHub when I am writing this post,\nwhile having over 150 Discord members, and 200 Telegram group members.</p>\n<p>We covers fields like AI, VRM, Live2D, UI design, multi-modal AI, game playing agents,\nstreaming APIs, bionic memory mechanisms, and many more. She is capable of playing games\nlike Minecraft, Factorio. We got another community member who is researching on\nintegrating her to be able to play and control Kerbal Space Program (KSP), as well as\nplay any arbitrary games.</p>\n<p>Many other companies are reaching out to us asking for collaboration, and we are\nworking on it, to make Project AIRI better, and more useful for the community.</p>\n<p>There is so much to do, and discover, we haven't reached the singularity of general purpose AI,\nperhaps Project AIRI will never made that point, but for now, having a companion-like AI agent\nto talk to, play games with, and share the knowledge and ideas with, is already a great\nachievement for me, and I hope it is for you too.</p>\n<p>This is only the beginning memory address of our dreams, <code>0x1</code>, the first byte of our journey.</p>\n<p>How much memory we could store? <strong>It depends on how much we could dream, and how much we could achieve together.</strong></p>\n<div style=\"margin-top: 24px; margin-bottom: 24px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;\">\n  <img src=\"https://raw.githubusercontent.com/moeru-ai/airi/main/docs/src/assets/images/blog/DreamLog-0x1/relu-sticker-wow.png\" alt=\"ReLU sticker wow\" style=\"width: 120px;\" />\n  <div style=\"text-align: center;\">\n    <span style=\"font-weight: bold; display: block;\">Thanks for reading all the way here!</span>\n    <span>Thanks for reading! Oh, and, Happy Birthday, Project AIRI!</span>\n  </div>\n</div>\n<div style=\"display: flex; flex-direction: column; background-color:rgba(55, 55, 55, 0.08); padding: 1rem; margin-bottom: 1rem;\">\n  <div style=\"font-weight: 600; font-size: 1.2rem; margin-bottom: 0.5rem;\">\n    New Release!\n  </div>\n  <div>\n    While you are reading this, we are preparing for the next release of Project AIRI, v0.6.0. Stay tuned!\n  </div>\n</div>\n","date_published":"Mon, 16 Jun 2025 00:00:00 GMT"},{"id":"https://blog.moeru.ai/xsai-0.2/","url":"https://blog.moeru.ai/xsai-0.2/","title":"Announcing xsAI 0.2 \"over the reality\"","content_html":"<p>I'm pleased to announce the release of xsAI v0.2.</p>\n<p>This version codename still corresponds to a song by Kizuna AI and you can listen to it:</p>\n<iframe width=\"100%\" height=\"405\" src=\"https://www.youtube.com/embed/OIdlW0u3ZXc\" title=\"YouTube video player\" frameborder=\"0\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n<p><s>btw, v0.1 is <a href=\"https://www.youtube.com/watch?v=FrcR9qvjwmo\">&quot;Hello World&quot;</a></s></p>\n<p>OK, so here's the new features:</p>\n<ul>\n<li><a href=\"https://blog.moeru.ai/xsai-0.2/#generate-image\">Generate image</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.2/#reasoning-utils\">Reasoning utils</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.2/#more-schema-library-supported\">More schema library supported</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.2/#more-providers\">More providers</a></li>\n<li><a href=\"https://blog.moeru.ai/xsai-0.2/#more-integrations\">More integrations</a></li>\n</ul>\n<h2 id=\"generate-image\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#generate-image\" class=\"header-anchor\">Generate Image</a></h2>\n<p>GPT 4o Image Generation is very popular these days, isn't it?</p>\n<p>Now you can also use it via API and <a href=\"https://xsai.js.org/docs/packages/generate/image\"><code>@xsai/generate-image</code></a>:</p>\n<pre><code class=\"language-ts\">import { generateImage } from '@xsai/generate-image'\nimport { env } from 'node:process'\n\nconst prompt = 'A children\\'s book drawing of a veterinarian using a stethoscope to listen to the heartbeat of a baby otter.'\n\nconst { image } = await generateImage({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'http://api.openai.com/v1/',\n  model: 'gpt-image-1',\n  prompt,\n})\n\nconst { images } = await generateImage({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'http://api.openai.com/v1/',\n  n: 4,\n  model: 'gpt-image-1',\n  prompt,\n})\n</code></pre>\n<p>If this feature is popular, we may introduce <code>editImage</code> later.</p>\n<h2 id=\"reasoning-utils\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#reasoning-utils\" class=\"header-anchor\">Reasoning Utils</a></h2>\n<p>We made <a href=\"https://xsai.js.org/docs/packages/utils/reasoning\"><code>@xsai/utils-reasoning</code></a> for models like <code>qwq</code> and <code>deepseek-r1</code>:</p>\n<pre><code class=\"language-ts\">import { generateText } from '@xsai/generate-text'\nimport { streamText } from '@xsai/stream-text'\nimport { extractReasoning, extractReasoningStream } from '@xsai/utils-reasoning'\n\nconst messages = [\n  {\n    content: 'You\\'re a helpful assistant.',\n    role: 'system'\n  },\n  {\n    content: 'Why is the sky blue?',\n    role: 'user'\n  },\n]\n\nconst { text: rawText } = await generateText({\n  baseURL: 'http://localhost:11434/v1/',\n  messages,\n  model: 'deepseek-r1',\n})\n\nconst { textStream: rawTextStream } = await streamText({\n  baseURL: 'http://localhost:11434/v1/',\n  messages,\n  model: 'deepseek-r1',\n})\n\n// { reasoning: string | undefined, text: string }\nconst { reasoning, text } = extractReasoning(rawText!)\n// { reasoningStream: ReadableStream&lt;string&gt;, textStream: ReadableStream&lt;string&gt; }\nconst { reasoningStream, textStream } = extractReasoningStream(rawTextStream)\n</code></pre>\n<h2 id=\"more-schema-library-supported\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#more-schema-library-supported\" class=\"header-anchor\">More schema library supported</a></h2>\n<p>We have supported <a href=\"https://v4.zod.dev/\">Zod 4 Beta</a> before it was officially released. (also includes <a href=\"https://v4.zod.dev/packages/mini\"><code>@zod/mini</code></a>!)</p>\n<p><a href=\"https://effect.website/docs/schema/introduction/\">Effect Schema</a> is supported as well.</p>\n<h2 id=\"more-providers\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#more-providers\" class=\"header-anchor\">More providers</a></h2>\n<p>We now support <a href=\"https://featherless.ai/\">Featherless</a>.</p>\n<p>Did you know we've added a lot of providers? view <a href=\"https://github.com/moeru-ai/xsai/tree/main/packages-ext/providers-cloud/src/providers\">here</a>.</p>\n<h3 id=\"special-providers\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#special-providers\" class=\"header-anchor\">Special providers</a></h3>\n<h4 id=\"new-%F0%9F%A4%97-transformer.js-provider\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#new-%F0%9F%A4%97-transformer.js-provider\" class=\"header-anchor\">New 🤗 Transformer.js provider</a></h4>\n<p>Have you dreamed about a possible future where you can use <code>xsAI</code> completely offline without Ollama and other inference server setup? We mentioned a bit in the previous blog post about our roadmap, here we come.</p>\n<p>We now get a new dedicated project called <a href=\"https://github.com/moeru-ai/xsai-transformers\"><code>xsai-transformers</code></a> on GitHub, where we wrapped the famous library to work with models and inference, <a href=\"https://huggingface.co/docs/transformers.js/en/index\"><code>Transformer.js</code></a> to help you get started on running embedding, speech, transcription, chat completions models with seamlessly designed API that compatible to xsAI, in both browser, WASM supported or WebGPU supported environments.</p>\n<p>If you are interested, <a href=\"https://xsai-transformers.netlify.app/\">try it on our live demo</a>.</p>\n<pre><code class=\"language-bash\">npm i xsai-transformers\n</code></pre>\n<p>It feels like this when using it:</p>\n<pre><code class=\"language-typescript\">import { createEmbedProvider } from 'xsai-transformers'\nimport embedWorkerURL from 'xsai-transformers/embed/worker?worker&amp;url'\nimport { embed } from 'xsai'\n\nconst transformers = createEmbedProvider({ baseURL: `xsai-transformers:///?worker-url=${embedWorkerURL}` })\n\n// [\n//   -0.038177140057086945,\n//   0.032910916954278946,\n//   -0.005459371022880077,\n//   // ...\n// ]\nconst { embedding } = await embed({\n  ...transformers.embed('Xenova/all-MiniLM-L6-v2'),\n  input: 'sunny day at the beach'\n})\n</code></pre>\n<h4 id=\"unspeech\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#unspeech\" class=\"header-anchor\">unSpeech</a></h4>\n<p>While you may notice <a href=\"https://github.com/moeru-ai/xsai/pull/136\">we removed unSpeech from <code>@xsai-ext/providers-local</code></a> (our written provider to connect speech synthesis services with the style of OpenAI API), this doesn't mean we completely gave up of unSpeech, instead, for the past month, we added support of <a href=\"https://www.alibabacloud.com/en/product/modelstudio\">Alibaba Cloud Model Studio</a> and <a href=\"https://www.volcengine.com/product/voice-tech\">Volcano Engine</a> to unSpeech.</p>\n<p>Therefore, it's time for <a href=\"https://www.npmjs.com/package/unspeech\">unSpeech to get its own package</a>, you can still use all the previous provided features by installing <a href=\"https://www.npmjs.com/package/unspeech\"><code>unspeech</code></a>:</p>\n<pre><code class=\"language-bash\">npm i unspeech\n</code></pre>\n<h2 id=\"more-integrations\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#more-integrations\" class=\"header-anchor\">More Integrations</a></h2>\n<p>Did you know? We now have official <a href=\"https://agentic.so/sdks/xsai\">Agentic</a> and <a href=\"https://voltagent.dev/docs/providers/xsai/\">VoltAgent</a> integrations.</p>\n<h2 id=\"join-our-community\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/xsai-0.2/#join-our-community\" class=\"header-anchor\">Join our Community</a></h2>\n<p>If you have questions about anything related to xsAI,</p>\n<p>you're always welcome to ask our community on <a href=\"https://github.com/moeru-ai/xsai/discussions\">GitHub Discussions</a>.</p>\n","date_published":"Thu, 01 May 2025 00:00:00 GMT"},{"id":"https://blog.moeru.ai/introducing-xsai/","url":"https://blog.moeru.ai/introducing-xsai/","title":"Introducing xsAI, a < 6KB Vercel AI SDK alternative","content_html":"<h2 id=\"why-another-ai-sdk%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#why-another-ai-sdk%3F\" class=\"header-anchor\">Why another AI SDK?</a></h2>\n<p><a href=\"https://sdk.vercel.ai/\">Vercel AI SDK</a> is way too big, it includes unnecessary dependencies.</p>\n<p><a href=\"https://pkg-size.dev/ai@4.1.47\"><img src=\"https://blog.moeru.ai/images/pkg-size-ai.png\" alt=\"pkg-size-ai\"></a></p>\n<p>For example, Vercel AI SDK shipped with non-optional\n<a href=\"https://opentelemetry.io/\">OpenTelemetry</a> dependencies, and bind the user to use <a href=\"https://zod.dev/\">zod</a> (you don't\nget to choose), and so much more...</p>\n<p>This makes it hard to build small and decent AI applications &amp; CLI tools with less bundle size and more controllable\nand atomic capabilities that user truly needed.</p>\n<p>But, it doesn't need to be like this, isn't it?</p>\n<h3 id=\"so-how-small-is-xsai%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#so-how-small-is-xsai%3F\" class=\"header-anchor\">So how small is xsAI?</a></h3>\n<p>Without further ado, let's look:</p>\n<p><a href=\"https://pkg-size.dev/xsai@0.1.0-beta.9\"><img src=\"https://blog.moeru.ai/images/pkg-size-xsai.png\" alt=\"pkg-size-xsai\"></a></p>\n<p>It's roughly a hundred times smaller than the Vercel AI SDK (*install size) and has most of its features.</p>\n<p>Also it is 5.7KB gzipped, so the title is not wrong.</p>\n<p><a href=\"https://pkg-size.dev/xsai@0.1.0-beta.9\"><img src=\"https://blog.moeru.ai/images/pkg-size-xsai-bundle.png\" alt=\"pkg-size-xsai-bundle\"></a></p>\n<h2 id=\"getting-started\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#getting-started\" class=\"header-anchor\">Getting started</a></h2>\n<p>You can install the <code>xsai</code> package, which contains all the core utils.</p>\n<pre><code class=\"language-bash\">npm i xsai\n</code></pre>\n<p>Or install the corresponding packages separately according to the required\nfeatures:</p>\n<pre><code class=\"language-bash\">npm i @xsai/generate-text @xsai/embed @xsai/model\n</code></pre>\n<h3 id=\"generating-text\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#generating-text\" class=\"header-anchor\">Generating Text</a></h3>\n<p>So let's start with some simple examples.</p>\n<pre><code class=\"language-ts\">import { generateText } from '@xsai/generate-text'\nimport { env } from 'node:process'\n\nconst { text } = await generateText({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'https://api.openai.com/v1/',\n  model: 'gpt-4o'\n  messages: [{\n    role: 'user',\n    content: 'Why is the sky blue?',\n  }],\n})\n</code></pre>\n<p>xsAI does not use the provider function <a href=\"https://sdk.vercel.ai/docs/foundations/providers-and-models\">like Vercel does</a> by default,\nwe simplified them into three shared fields: <code>apiKey</code>, <code>baseURL</code> and <code>model</code>.</p>\n<ul>\n<li><code>apiKey</code>: Provider API Key</li>\n<li><code>baseURL</code>: Provider Base URL (will be merged with the path of the corresponding util, e.g. <code>new URL('chat/completions', 'https://api.openai.com/v1/')</code>)</li>\n<li><code>model</code>: Name of the model to use</li>\n</ul>\n<blockquote>\n<p>Don't worry if you need to support non-OpenAI-compatible API provider, such as <a href=\"https://claude.ai/\">Claude</a>, we left the possibilities to override\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\"><code>fetch(...)</code></a> where you can customize how the request is made,\nand how the response was handled.</p>\n</blockquote>\n<p>This allows xsAI to support any OpenAI-compatible API without having to create provider packages.</p>\n<h3 id=\"generating-text-w%2F-tool-calling\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#generating-text-w%2F-tool-calling\" class=\"header-anchor\">Generating Text w/ Tool Calling</a></h3>\n<p>Continuing with the example above, we now add the tools.</p>\n<pre><code class=\"language-ts\">import { generateText } from '@xsai/generate-text'\nimport { tool } from '@xsai/tool'\nimport { env } from 'node:process'\nimport * as z from 'zod'\n\nconst weather = await tool({\n  name: 'weather',\n  description: 'Get the weather in a location',\n  parameters: z.object({\n    location: z.string().describe('The location to get the weather for'),\n  }),\n  execute: async ({ location }) =&gt; ({\n    location,\n    temperature: 72 + Math.floor(Math.random() * 21) - 10,\n  }),\n})\n\nconst { text } = await generateText({\n  apiKey: env.OPENAI_API_KEY!,\n  baseURL: 'https://api.openai.com/v1/',\n  model: 'gpt-4o'\n  messages: [{\n    role: 'user',\n    content: 'What is the weather in San Francisco?',\n  }],\n  tools: [weather],\n})\n</code></pre>\n<p>Wait, <a href=\"https://zod.dev/\"><code>zod</code></a> is not good for tree shaking and annoying. Can we use <a href=\"https://valibot.dev/\"><code>valibot</code></a>? <strong>Of course!</strong></p>\n<pre><code class=\"language-ts\">import { tool } from '@xsai/tool'\nimport { description, object, pipe, string } from 'valibot'\n\nconst weather = await tool({\n  name: 'weather',\n  description: 'Get the weather in a location',\n  parameters: object({\n    location: pipe(\n      string(),\n      description('The location to get the weather for'),\n    ),\n  }),\n  execute: async ({ location }) =&gt; ({\n    location,\n    temperature: 72 + Math.floor(Math.random() * 21) - 10,\n  }),\n})\n</code></pre>\n<p>We can even use <a href=\"https://arktype.io/\"><code>arktype</code></a>, and the list of compatibility will grow in the future:</p>\n<pre><code class=\"language-ts\">import { tool } from '@xsai/tool'\nimport { type } from 'arktype'\n\nconst weather = await tool({\n  name: 'weather',\n  description: 'Get the weather in a location',\n  parameters: type({\n    location: 'string',\n  }),\n  execute: async ({ location }) =&gt; ({\n    location,\n    temperature: 72 + Math.floor(Math.random() * 21) - 10,\n  }),\n})\n</code></pre>\n<blockquote>\n<p>xsAI doesn't limit your choices into either <a href=\"https://zod.dev/\"><code>zod</code></a>, <a href=\"https://valibot.dev/\"><code>valibot</code></a>, or <a href=\"https://arktype.io/\"><code>arktype</code></a>, with\nthe power of <a href=\"https://github.com/standard-schema/standard-schema\">Standard Schema</a>, you can use any schema library it supported you like.</p>\n</blockquote>\n<h3 id=\"easy-migration\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#easy-migration\" class=\"header-anchor\">Easy migration</a></h3>\n<p>Are you already using the Vercel AI SDK? Let's see how to migrate to xsAI:</p>\n<pre><code class=\"language-diff\">- import { openai } from '@ai-sdk/openai'\n- import { generateText, tool } from 'ai'\n+ import { generateText, tool } from 'xsai'\n+ import { env } from 'node:process'\nimport * as z from 'zod'\n\nconst { text } = await generateText({\n+ apiKey: env.OPENAI_API_KEY!,\n+ baseURL: 'https://api.openai.com/v1/',\n- model: openai('gpt-4o')\n+ model: 'gpt-4o'\n  messages: [{\n    role: 'user',\n    content: 'What is the weather in San Francisco?',\n  }],\n- tools: {\n+ tools: [\n-   weather: tool({\n+   await tool({\n+     name: 'weather',\n      description: 'Get the weather in a location',\n      parameters: z.object({\n        location: z.string().describe('The location to get the weather for'),\n      }),\n      execute: async ({ location }) =&gt; ({\n        location,\n        temperature: 72 + Math.floor(Math.random() * 21) - 10,\n      }),\n    })\n- },\n+ ],\n})\n</code></pre>\n<p>That's it!</p>\n<h2 id=\"next-steps\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#next-steps\" class=\"header-anchor\">Next steps</a></h2>\n<h3 id=\"big-fan-of-anthropic's-mcp%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#big-fan-of-anthropic's-mcp%3F\" class=\"header-anchor\">Big fan of <a href=\"https://www.anthropic.com/news/model-context-protocol\">Anthropic's MCP</a>?</a></h3>\n<p>We are working on <a href=\"https://modelcontextprotocol.io/introduction\">Model Context Protocol</a> support: <a href=\"https://github.com/moeru-ai/xsai/pull/84\">#84</a></p>\n<h3 id=\"don't-like-any-of-the-cloud-provider%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#don't-like-any-of-the-cloud-provider%3F\" class=\"header-anchor\">Don't like any of the cloud provider?</a></h3>\n<p>We are working on a <a href=\"https://huggingface.co/docs/transformers.js/index\">🤗 Transformers.js</a> provider that enables you to directly run LLMs and any\n🤗 Transformers.js supported models directly in browser, with the power of WebGPU!</p>\n<p>You can track the progress here: <a href=\"https://github.com/moeru-ai/xsai/issues/41\">#41</a>. It is really cool and playful to run embedding, speech,\nand transcribing models directly in the browser, so, stay tuned!</p>\n<h3 id=\"need-framework-bindings%3F\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#need-framework-bindings%3F\" class=\"header-anchor\">Need framework bindings?</a></h3>\n<p>We will do this in v0.2. See you next time!</p>\n<h2 id=\"documentation\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#documentation\" class=\"header-anchor\">Documentation</a></h2>\n<p>Since this is just an introduction article, it only covers <code>generate-text</code> and <code>tool</code>.</p>\n<p><code>xsai</code> <a href=\"https://github.com/moeru-ai/xsai/blob/main/packages/xsai/src/index.ts\">has more utils:</a></p>\n<pre><code class=\"language-ts\">export * from '@xsai/embed'\nexport * from '@xsai/generate-object'\nexport * from '@xsai/generate-speech'\nexport * from '@xsai/generate-text'\nexport * from '@xsai/generate-transcription'\nexport * from '@xsai/model'\nexport * from '@xsai/shared-chat'\nexport * from '@xsai/stream-object'\nexport * from '@xsai/stream-text'\nexport * from '@xsai/tool'\nexport * from '@xsai/utils-chat'\nexport * from '@xsai/utils-stream'\n</code></pre>\n<p>If you are interested, go to the documentation at <a href=\"https://xsai.js.org/docs\">https://xsai.js.org/docs</a> to get started!</p>\n<p>Besides xsAI, we made loads of other cool stuff too! Check out our <a href=\"https://github.com/moeru-ai\"><code>moeru-ai</code> GitHub organization</a>!</p>\n<h2 id=\"join-our-community\" tabindex=\"-1\"><a href=\"https://blog.moeru.ai/introducing-xsai/#join-our-community\" class=\"header-anchor\">Join our Community</a></h2>\n<p>If you have questions about anything related to xsAI,</p>\n<p>you're always welcome to ask our community on <a href=\"https://github.com/moeru-ai/xsai/discussions\">GitHub Discussions</a>.</p>\n","date_published":"Mon, 03 Mar 2025 00:00:00 GMT"},{"id":"https://blog.moeru.ai/hello-world/","url":"https://blog.moeru.ai/hello-world/","title":"Hello, World!","content_html":"<p>Welcome to the Moeru AI Blog.</p>\n","date_published":"Tue, 25 Feb 2025 00:00:00 GMT"}]}