Coder Social home page Coder Social logo

rusty-slm's Introduction

Rusty-SLM

This is a program for controlling SLMs with rust and python. The server is implemented in rust with grpc, allowing for control from any programming language that can connect to a web endpoint.

Binaries

There's binaries in the releases section to download, which should run on windows and linux without extra stuff.

Server Compilation

Windows

For compiling on windows:

  1. Install rust (using rustup. You'll probably need to install the msvc c++ build-tools as well)
  2. Install the Vulkan SDK
  3. Download this repository, and go into the root directory
  4. Run cargo build --release
  5. The executable should be created as: target/release/rusty-slm-server.exe
  6. Run this executable from the terminal with a port number like: rusty-slm-server.exe 9000

Linux

For compiling on linux: Follow the same instructions as windows, but remove the .exe from the file name.

Mac

Probably the same as linux?

Python Client Installation

This repo also contains a simple python client for communicating with the server. You can install this through pip with:

pip install git+https://github.com/maxastyler/rusty-slm

Client Usage

Import the rusty_slm package into python, and create an SLMController object.

import numpy as np
from rusty_slm import SLMController

slm = SLMController(SERVER_PORT_NUMBER)
slm.set_screen(0)
slm.set_image(np.random.randint(0, 256, (1920, 1080), dtype=np.uint8))

You can use set_screen to change which monitor the image is displayed on, and set_image to set the image. set_image takes a uint8 numpy array as an argument, which can have a shape (W, H) for greyscale images, or (W, H, 3) for colour images.

Usage from another language

The server communicates with clients using the GRPC system, which has implementations in loads of different languages. You can find the protobuf definition in protos/slm.proto, which is pretty simple.

Todo

  • Implement a function to return a full list of monitors, and their properties
  • Option to set a monitor by name, rather than number

rusty-slm's People

Contributors

maxastyler avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

surajgoel5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.