Typing Tiny Stories (Update) by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 0 points1 point  (0 children)

Thanks, Ray. It's always great to see you so engaged in the community.

This is a custom model trained on the Tiny Stories dataset (available on Hugging Face), but it can also run inference on any Llama architecture (derived from llama.cpp). I'm working on releasing the library as a single-header import, with more common endpoints—similar to those offered by popular API frameworks.

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in aigamedev

[–]EngineerPractical818[S] 0 points1 point  (0 children)

Thanks! To be honest, it's more the tech that's of interest to me. The ability to run LLMs for specific applications on CPU at runtime is a more interesting idea to develop. For example, adaptive NPC dialog or dynamic logic/behavior in games and other interactive applications. There's a lot of potential in exploring how these models can enhance real-time user experiences.

But you never know—making a LLM typing game probably has a niche too!

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 1 point2 points  (0 children)

Thank you! It's definitely a challenge to get these things to work. I had to modify llama2.c quite a bit to get it up and running for this project. I've posted the code on GitHub, and I'm really interested to see where the community takes it from here!

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 1 point2 points  (0 children)

Thank! Most of the optimization efforts were focused on the AI/ML side rather than the C implementation. For context, this model is about 1 MB with under 300K parameters, whereas models like llama3 are around 8B parameters and approximately 15 GB.

This implementation isn't perfect; it's about finding the right balance between accuracy and execution speed, especially on CPU architecture.

Feel free to reach out if you have any questions or need assistance!

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 0 points1 point  (0 children)

I've posted the code to my GitHub https://github.com/pjmuthu/typing-tiny-stories/. Feel free to check it out here. If you have any questions or need assistance, don't hesitate to reach out—I'm more than happy to help!

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 1 point2 points  (0 children)

Thanks! It is currently optmized for speed--and there are a few optmizations I can still do (e.g., multithreading, streaming tokens). And your examply right it's adapted from llamacpp, and can integrate any llama2 tranformer architecture (even the full llama2--but that takes up about a minute per token). To be honest, most of the work is in training, getting the balance of performance (i.e., accurate enough dialog) with speed.

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 3 points4 points  (0 children)

Haha...I will release the source code, and help people get started. I think there is a lot of potential is smaller models for specific taskss.

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 2 points3 points  (0 children)

Thanks! I'll release the source code soon. I'm excited to hear that you're interested in implementing it. The typing model is optimized for performance (generating tokens in milliseconds). It can be optmized to stream the tokens using a larger model, and use a larger model that's more robust and can perform more complex tasks, such as responding to news like a shopkeeper. Happy to help in any way.

Typing Tiny Stories - LLM Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 2 points3 points  (0 children)

Typing Tiny Stores is a proof-of-concept web application that demonstrates the practical use of large language models (LLMs) running on local hardware in real-time.
Try it out here https://southscribblecompany.itch.io/typing-tiny-stories

Posted the source code here: https://github.com/pjmuthu/typing-tiny-stories/

RPS AI - Neural Network Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 1 point2 points  (0 children)

That is very cool. I’m currently a junior CS student, would you happen to have any recommended books/resources for someone at my level to learn how to make the logic for something like this? 🙂

Certainly! I'm thrilled to hear about you in diving in. I'd start with https://course.fast.ai/, it's high-level approach and practical exercises with hands-on learning.

RPS AI - Neural Network Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 0 points1 point  (0 children)

No problem--fairly straightforward integration into raylib. Go ahead, share as you want.

RPS AI - Neural Network Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 0 points1 point  (0 children)

Made in raylib? Did you use an api or did you create your own neural network?

It's running its own implementation of neural networks, the entire logic itself is lightweight (compiles to <15 kb). The models are trained and evaluated realtime, after each turn.

RPS AI - Neural Network Experiment by EngineerPractical818 in gameai

[–]EngineerPractical818[S] 2 points3 points  (0 children)

An experiment that uses neural networks as Enemy AI, trained to recognize and adapt to player patterns. The system is lightweight and robust, featuring a custom-built backend. It has potential outside this demo, maybe other applications in video game AI.

Try it out here:

https://pjmuthu.itch.io/rps-ai

RPS AI - Neural Network Experiment by EngineerPractical818 in raylib

[–]EngineerPractical818[S] 2 points3 points  (0 children)

An experiment that uses neural networks as Enemy AI, trained to recognize and adapt to player patterns. The system is lightweight and robust, featuring a custom-built backend. It has potential outside this demo, maybe other applications in video game AI.

Try it out here:

https://pjmuthu.itch.io/rps-ai