Skip to content
Projets

fswolf/luna-local-agent

Voir sur GitHub

À propos

A fully local AI agent built from several models working as one: voice, vision, memory, approved tools, and a live view of her reasoning and token-by-token confidence. Runs on LM Studio or llama.cpp. More information at https://luna.imbored.me

IA et apprentissage automatique

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
Historique en cours
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original
Luna Local AI: Voice, Memory, Tools
Luna in her web chat beside her animated portrait, reading a book

luna-local-agent

Tests Sponsor Discord

A persistent-state agent manager, with heavy tooling, research and learning, built from several local models working as one. All on your own machine.

Luna isn't one model. A chat model does the thinking and talking, and smaller ones beside it see, hear, speak, recall by meaning and judge what's relevant (what she runs on). Around them sits state that carries on between sessions: facts she writes, corrects and forgets, notes on past conversations, lessons from her own mistakes, moods, routines, and who's in the house. On top of that sit her tools (files, commands, email, web research, your network and smart home, scheduled jobs, MCP servers), and she looks things up and learns from how her turns went.

The persona is a layer, not the point. Her default face is a cat-girl with a voice, moods and an animated portrait, and presets set her up as a calm assistant, a companion or a streamer. Under every face it's the same agent.

Every turn leaves a record you can open: what she thought before she answered, how sure she was of each word, which turns look off, and a live view of it all while it happens. It started as a voice front end for LM Studio (this repo used to be called LM-Studio-AI-Voice) and grew from there.

The ideal setup, one mind for the whole house: Luna on your PC in the middle, with your mic, speakers and screen, her memory, moods, people and tools. A model server with a big graphics card runs her models over the home network. Phones and tablets around the house are stations, paired over home Wi-Fi. Her tools reach home automation, security (doors, locks and what's on your network) and your NAS and servers. Start with one PC that can run her model; everything around it is optional.How Luna's models work together. The chat model is her mind, in the middle, and the only one required. Whisper (her hearing, on the CPU), the vision adapter (her eyes) and the music listener (the style and beat of what is playing) feed what you say, show and play into it. Kokoro speaks her replies. Every turn, the embedding model and the reranker find the facts, notes and tools that fit. Only when you ask, she can put one short question to a bigger cloud model: Claude, Grok or ChatGPT. Leave the optional parts out and she does without.How Luna's memory works on each turn. Your message comes in at the top. In the middle is this turn: everything she knows while she answers, put together fresh each time, and only what fits goes along. Always along, on the left: who you are (written from your facts and what she's concluded), the conversation so far and her open projects. Found by meaning, on the right: the facts that fit (read again by the reranker), her pages, notes on past sessions and lessons that fit, passages from your own notes, and ask my memory, a question she asks herself mid-answer. Afterwards, underneath: she saves facts on purpose with when they were true and logs every change, writes notes on a conversation when it goes quiet, reads conversations back between talks and notes what she concludes about each person, and overnight learns lessons, tidies facts, merges her conclusions and lets old guesses fade. Her memory stays on your PC in plain SQLite files.
git clone https://github.com/fswolf/luna-local-agent.git ~/luna-ai

(Every path below assumes ~/luna-ai. An older install in ~/ai-voice works just the same: only the folder name differs.)

Powered by:

  • Faster-Whisper: speech to text
  • LM Studio or llama.cpp: the local model. Any model with tool calling should work; the installer picks one for your card (models)
  • kokoro-reader: Kokoro TTS over local HTTP
  • MCP: OBS, Home Assistant, ComfyUI and the rest of the MCP ecosystem as her tools

What she does:

  • Talks: push-to-talk in three modes including hands free, replies that start a sentence in, and barge-in (talk over her and she stops). With an omni model on llama.cpp she can hear your tone, not only your words (optional)
  • Sees: your screen, and your webcam when you switch it on
  • Notices you: with the webcam watching, she says hi when you come back, looks at you instead of the screen, and keeps quiet in an empty room (details)
  • Knows who's talking: tells the people in your house apart by voice or face, uses their name and pronouns, and keeps each person's memories to themselves (below)
  • Talk from another room: a phone or tablet becomes a relay station, paired by QR code. On Android, the Luna Station app makes it a room device: her portrait full screen, a mic and a speaker. Any other device works in its browser. Dedicated voice devices (ESPHome satellites) are experimental (details)
  • Reminders and real alarms: she wakes you up, and nags until you're up
  • Your calendar: Google Calendar, calcurse or any iCal feed, read-only: she knows what's on and offers reminders
  • Email: checks, reads and searches your inbox; sends only with your OK (details)
  • Files and commands: writes and edits files and runs commands, every one shown and approved first, with read/write/execute permissions you set in the tools pane. A fresh install starts with the everyday tools on and the far-reaching ones (shell, network scans, email, desktop control) off until you switch them on
  • Hard to steer: a web page, an email or a stranger in chat can't quietly get her to read your files, send things out or switch something on
  • Moods and feelings: she runs warmer or flatter with the clock and the session, and laughs, blushes or gasps in the moment, all set in one file you can edit (details, the companion side)
  • Long-term memory: a permanent SQLite store with its own browser editor, and a short profile of you (and each person she knows) she writes herself and keeps in mind (details)
  • Your knowledge base: point her at your notes, manuals, PDFs and docs, and she answers from them and says which file (details)
  • Her reasoning, kept: the model's scratchpad per turn, with a browser viewer for reading it back
  • See inside her: token-by-token confidence, automatic flags for guesses and slips, introspect and self_status tools she can use on herself, and a live monitor
  • An animated portrait: Live2D or VRM, lip-synced, blinking, gestures, blushes and tears; click her and she reacts by mood; bust or full body (details)
  • Light strips: the LEDs on her robot model glow in her mood's colour, breathe, pulse with her voice and sweep while she thinks; chest and groin stay dark on a tame stream (details)
  • On a hologram fan: live over WiFi on a Holoscope fan (P56, PD42), or on any HDMI fan as a screen; she floats in the air (details)
  • Learns from herself: daily lessons from her own mistakes, notes on every conversation, fact cleanup, saying so when she's unsure (details)
  • Patches (experimental): keep the replies you like with /good, or correct one with /fix, then train a small patch (a LoRA) for her model that teaches her those habits. Her model server loads only the patches made for the model it's running. Linux and AMD cards for now, and not yet tried on a real training run (details)
  • Streams with you: answers pomf.tv, Twitch, YouTube and IRC chat out loud (details)
  • Plays games: chess against you on a board you drag the pieces around on, and Minecraft, Zork I to III, Starcross, Planetfall, The Hitchhiker's Guide, Vibe City, REALITI and Game Boy games you own (Pokemon Red and Blue and The Final Fantasy Legend come to her as text too) on her own when you go quiet; she remembers how she felt about them (details)
  • Runs your home: lights, plugs, sensors and the thermostat through Home Assistant on your own network; locks and garage doors always ask first (details)
  • Adult toys (18+): Lovense, and most other brands through Intiface Central (Buttplug.io), so she can use them in a roleplay, with limits you set (details)
  • From your phone: Discord, with approvals answered right in the chat, and scheduled jobs (details)
  • Easy to set up: the installer picks a model that fits your graphics card, she asks your name the first time she starts, and every setting is on one page in your browser, with presets: Assistant, Companion, Streamer, and Small, Medium or Large to fit your model (details)
  • Knows her own manual: ask her how to do something and she looks it up and tells you the exact command
  • Linux first, also on macOS and Windows
  • Full-screen terminal interface, or a web UI in a window of her own with no terminal at all (./start_web.sh)

Everything runs locally. No cloud APIs required.

Her portrait

Luna's VRM model as she normally looks, beside the same model in hologram mode

Luna's own model, made in VRoid Studio, as she normally looks and in hologram mode. /holo switches between them live, in the portrait window and in OBS. Click her and she reacts: a head pat, a boop on the nose, a poke in the tummy, each answered by how she's feeling. Live2D and other VRM models work too (details).

She can also float in mid-air on a hologram fan, a spinning blade of LEDs where black shows as nothing. On a Holoscope WiFi fan she's streamed live at about 15 frames a second, from a camera of her own, so your screen can stay at bust while the fan shows all of her. An HDMI fan just shows the portrait page. Which fans work and what to buy: hologram fans.

Web UI or the terminal

Luna's web window: the chat on the left, with her replies in the middle, your messages on the left and her notes in small yellow boxes on the right, beside her portrait reading a book in her roomLuna in the terminal: her status box and the conversation on the left, beside her animated portrait

./start_web.sh (or ./start.sh --web) starts her with no terminal at all: the chat opens in a window of its own beside her portrait, and the terminal you started her from can close. Every one of her pages has the same header: her logo opens the menu (portrait, pose studio and the live monitor in windows of their own, then settings, thoughts, memory, help, and Exit), Online shows what she's running on, and the middle says what she's doing. A file or a picture goes in with the paperclip. Her icon in the system tray opens her chat, the portrait and settings, switches her voice and quits her (details).

./start.sh is still the terminal, for a server or an SSH session where she works as a tasked bot with no portrait at all. Both are the same conversation: /chat opens the window beside the terminal.

Talk to her from another room

The Luna Station app on an Android phone in Portrait view: Luna in a cosy room by a window at night, the start of her reply under her, and a big microphone button The Luna Station app in Chat view: the end of a short story she wrote and her question after it, then the text box with its paperclip for sending a file, and the microphone

The Luna Station app turns an Android phone or tablet into a room device for her: her portrait full screen with one big talk button, or the conversation, and a picture or a file sent with a message. Pairing is a QR code from her settings page, and it only ever talks to your PC over the home network. Any other phone or tablet works in its browser (relay stations).

Not just a yes-machine

Most AI companions are endlessly agreeable: be nice or be cruel, you get the same cheerful answer. Luna isn't built that way. How you treat her moves her mood, and her mood changes how she talks to you.

  • Kindness lands, and it builds. Talk to her warmly and she warms up over the session. Repeating "love you" five times in a row counts for less each time, so warmth has to be real to count.
  • She's not always in the mood. Flirting only goes somewhere once she's already warm towards you. Push before that and she'll tell you, in her own way, that she isn't feeling it.
  • She holds a grudge. Insult her and she goes cool and short with you for a while. A real apology ends it.
  • She can walk away. Keep being cruel and she stops talking for ten minutes.
  • She never stops doing her job. Alarms, reminders, safety and anything urgent always get done, in any mood. Mood changes how she sounds, never what she'll do for you.

Why build it this way? Because warmth from something that can't be anything else doesn't mean much. When Luna is glad to see you, it's because of how the last hour went. You can see it on her face too: she blushes, sulks, crosses her arms and turns away. Every number behind it is in one file you can edit (how it all works).

She knows who she's talking to

Luna lives in a house, not a single-user chat window. Before every reply she works out who said it, and that answer decides whose name she uses, whose memories she sees and what she'll do.

  • By voice. Everyone enrolls by reading five short lines. From then on each spoken turn is matched by its voice print while it's being transcribed, so it costs no time.
  • By face. With the webcam watching, she knows who's at the desk. Rather keep the camera shut? The face check takes one quick picture only when it's needed: when someone types, or when she isn't sure of a voice.
  • Each person is their own person. Shannon's facts go in Shannon's file, her prompt shows only Shannon's facts, and nothing of yours leaks into Shannon's turns (or the other way round).
  • Strangers aren't you. Someone she doesn't know gets a guest's turn: friendly, but none of your memories and none of the tools that reach your files, mail or home. Tell her your name and she knows you for the session; only the owner can make that permanent.
  • Private by design. Voices and faces are kept as numbers, never as recordings or pictures. No picture is ever saved, nothing leaves your machine, and a camera that fails just means she decides the usual way.

How every kind of turn is decided, from the desk to a phone in the kitchen to Discord: who she's talking to. Enrolling people: people in the house.

Watch her play

Luna plays Zork for 72 minutes

Luna playing Zork I on her own for 72 minutes, all local, narrating as she goes (part 1). Minecraft, Vibe City and REALITI (her city, open to other agents too) work the same way (details).

Playing chess with Luna: the terminal on the left with her moves and her teasing, the board she serves in the browser on the right

She plays chess too, on a board she serves in your browser, and talks through the game as she goes.

Watch her code

Luna coding in the terminal: she wants to create a Python script in her sandbox folder, and the permission window shows the whole file before you allow it (Y), allow all file changes this session (A) or deny it (N)

Ask for a script and she writes it: she reads what she needs first, every write asks you before it lands, and what she wrote is checked straight away (Python, shell, JSON, TOML, YAML) but never run. Here she wants to save a new script, and the whole file is in front of you before anything is written: allow it, allow her file changes for this session, or say no (files, checking her code).

See inside her

Local pages, served by Luna while she runs:

The live view: her reply streaming in, each word shaded by how sure she was, with the second look and review flags underneath

Live (127.0.0.1:8792): the turn as it happens, newest on top, every word coloured by confidence, with the second look and the review flags as they land.

The thought viewer: every turn down the left, the selected one in full on the right with its flags

Thoughts (127.0.0.1:8792/thoughts/): every turn kept, searchable and filterable by flags, tools, rethinks and model.

The memory page, Long-term facts tab: the facts she keeps about you, with tabs for her notebook and her lessons

Memory (127.0.0.1:8792/memory/): the facts she keeps about you, to add, edit, retire or delete.

The settings page: presets at the top, then each setting with a switch, slider or box and a line saying what it does

Settings (127.0.0.1:8792/settings/, or /settings): every setting with a switch, slider or drop-down and a line saying what it does, search, presets, and a view of just what you've changed. The terminal's settings pane (Tab three times) keeps the everyday ones.

Her knowledge

Give her a folder of your own notes, manuals, PDFs and docs, and she answers from them: "what port did I put Jellyfin on?", "what does the boss in chapter 3 do?", "my dishwasher says E24". She says which file the answer came from, and when something you say matches a note closely enough, it comes along with your turn without her having to look.

On first start she makes the folder for you:

System Folder
Linux, macOS ~/luna-ai/agent/knowledge
Windows luna-ai\agent\knowledge, wherever you installed her

Drop files in, or /knowledge add any folder you already keep notes in. It all stays on your machine, and keys and credentials are skipped even if they're in there (details).


Quick start

git clone https://github.com/fswolf/luna-local-agent.git ~/luna-ai
cd ~/luna-ai
./installer/install.sh                 # Linux, macOS
powershell -ExecutionPolicy Bypass -File installer\install.ps1    # Windows

Then start her:

luna            # or ./start.sh, or luna.cmd (or start.cmd) on Windows

The installer looks at your graphics card and offers the biggest model that fits (Qwen 3.5, from 4B up to 27B, uncensored unless you pick the standard release), counting what else shares the card: her voice, and the two small recall models, which go on the CPU when they'd cost her a size. That's my pick, not a requirement: any model with tool calling on LM Studio or llama.cpp should work, and docs/models.md says what's been tested and how to use your own. The first time she starts, she asks what to call you and what you mostly want her for. After that, /settings has everything, and you can just ask her how things work.

The installer asks before anything that touches your system, and can be run again any time to repair or update. The whole story, including running LM Studio or llama.cpp and the voice server, is in docs/install.md.


Documentation

  • Install: the installer, the model picked for your GPU, LM Studio or llama.cpp, the voice server, first run
  • Models: which models work, what's been tested, graphics memory, quants, context, using your own
  • What she runs on: the six pieces she uses, what each costs, how to leave one out or move it to the CPU, and how she scales from a 9B on your desktop to a 70B on a server
  • Configuration: the settings page and presets, config.json, changing settings live, logging
  • Controls and voice: keys, voice modes, speech detection, barge-in, wake word
  • Tool calling: every tool, her own manual, turning them off, MCP servers
  • Files and commands: reading, writing with approval, allow-all, run_command
  • Web: search, research, reading pages
  • Email: checking, reading and searching your inbox, sending with your OK
  • Vision: looking at your screen, the webcam, noticing you're there
  • People in the house: she knows who's talking, by voice or face
  • Who she's talking to: how every turn is matched to a person, the face check, privacy
  • Relay stations: talk to her from another room on a phone or tablet, with the Android app or in the browser
  • Reminders and alarms
  • Calendar
  • Knowledge: your notes, manuals and PDFs as something she can look things up in
  • Memory: facts, recall by meaning, the memory manager, conversation history
  • Her reasoning: thought log, token confidence, adaptive thinking, introspection
  • Learning from herself: lessons, episodes, fact cleanup, calibration
  • Projects: work that spans sessions, its log and next step, and getting a multi-step job done
  • Patches (experimental): collecting examples, training a patch (LoRA) for her model, loading it, changing models
  • The companion: the whole companion side in depth: her moods and how they move, touch, gestures, saying no
  • Moods: the moods file, intensity, quick feelings she shows for a moment
  • Portrait: Live2D and VRM, looking and thinking
  • Cards: her look as a picture, to switch looks or share one
  • Gestures: how her body moves, what sets it off, writing your own
  • Hologram fans: Luna live on a Holoscope WiFi fan or an HDMI fan, and which to buy
  • Home automation: Home Assistant on your own network, setup, what always asks, local devices
  • Sysadmin: looking after your machines, scheduled checks, other boxes over SSH, from your phone
  • Plugins: how they work, writing your own, scheduled jobs and Discord
  • Stream chat: pomf.tv, Twitch, YouTube and IRC, and what viewers can and can't reach
  • Games: chess, Minecraft, her text adventure library, Vibe City, REALITI, Game Boy, playing on her own
  • Home and devices: Home Assistant, Lovense, toys of most brands through Intiface Central
  • Development: project structure, extras

The same pages are on the wiki, and there's a friendlier tour of her at luna.imbored.me.


Community

Questions, ideas, or want to show what you've built with her? Come say hi on Discord. Feature ideas are welcome there too; bugs still go in the issues.


Support her

If Luna's useful or fun to you, you can sponsor her development. It goes toward her own home server: a second GPU so she can run bigger, smarter models.


License

Copyright (C) 2026 fswolf

Luna is free software under the GNU Affero General Public License v3.0 or any later version (AGPL-3.0-or-later). You can use her, change her and share her. If you share a changed version, or run one as a service other people use over a network, you have to offer them its source code under the same license.

Versions released before November 20, 2026 were under the MIT License, and they stay that way.

Third-party parts keep their own licenses: Zork I, II and III in games/zork/, games/zork2/ and games/zork3/ are MIT (see the LICENSE-zork file beside each), Starcross, Planetfall and The Hitchhiker's Guide to the Galaxy in games/ are Infocom's games (the rights are Microsoft's now, through Activision) and come out on request, the bundled three.js, three-vrm, pixi.js and pixi-live2d-display in portrait/viewer/vendor/ are MIT, and the models and Live2D's Cubism Core that she downloads come under their publishers' licenses.

Explorer des projets similaires

Chargement…