# 🙊 Razvalica

Razvalice is an alternative control server for Yandex Stations.

## Software

Control server stack is OSS:

* Main LLM processor - <https://github.com/radioegor146/alice-processor>
* Simple implementation of Function/State server - <https://github.com/radioegor146/alice-function-state-server>
* Speaker identifier using models from Yandex Stations - <https://github.com/radioegor146/alice-speaker-identifier>
* Main Quasar (Yandex) server emulator - <https://github.com/radioegor146/quasar-server>
* STT using Sber’s GigaAM - <https://github.com/radioegor146/quasistreaming-gigam>
* Service that allows pushes through MQTT (converts MQTT → REST API) - <https://github.com/radioegor146/alice-push-service>
* Simple TTS using different Microsoft SpeechAPI backends on Linux through Wine - <https://github.com/radioegor146/microsoft-sapi-openai>

## Hardware

* [Wailord](/doc/wailord-MyMwL4LPYI) serves both Quasar backend and NNs required.
* Yandex Station Gen. 2 in [Open Space](/doc/open-space-lzUNE3L3Bd).

## How to change prompt?

```bash
# Connect to Quasar VM via Teleport
tsh ssh root@quasar

# Open Docker deployment
cd deployments/quasar

# Edit the "prompt.handlebars" file containing plain text prompt
nano prompt.handlebars

# Restart Quasar backend to apply changes
docker compose restart

# Commit your changes
git add prompt.handlebars
git commit -m "prompt: lesser the horniness, straightforward response on actions"
```

## How to push notifications to TTS or to LLM?

There are two MQTT topics and a REST API for this:

```ini
# Topic for push to LLM - your text will be added as 
# { type: "system", text: "External event happened: '$text'" }
# Push to all
bus/services/alice/event
# Push to specific
bus/services/alice/DUID/event 

# Topic for push to TTS to all stations - your text will be pushed directly without LLM
# Push to all
bus/services/alice/event/raw
# Push to specific
bus/services/alice/DUID/event/raw
```

Also, REST API [exists](http://quasar.int.bksp.in:31116/openapi)

Using MQTT is preferrable, but not required (just remember - I’m a dumb person and can change REST API at will)

---

**Documents**

- [BKSP 101](https://wiki.bksp.in/s/public/doc/bksp-101-HvrtlzB32F)
- [Проекты](https://wiki.bksp.in/s/public/doc/proekty-yjWZscgTvo)
- [Infrastructure](https://wiki.bksp.in/s/public/doc/infrastructure-VPKsJwVSVh)
- [Пространство](https://wiki.bksp.in/s/public/doc/prostranstvo-UF1eSbQDi5)
- [Equipment](https://wiki.bksp.in/s/public/doc/equipment-t5MYAVJ8l0)
- [Other](https://wiki.bksp.in/s/public/doc/other-uPW1YJQaRt)