npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@altiplano/taskserver

v0.0.1

Published

Altiplano tasks server

Downloads

5

Readme

Altiplano tasks server

A language model tasks api server. Serve tasks from simple yaml files

Install:

yarn global add @altiplano/taskserver
# or 
npm install -g @altiplano/taskserver

Usage

Create a task

mkdir tasks
cd tasks
touch mytask.yaml

The task content:

name: fix_json
model: open-llama-7B-open-instruct.ggmlv3.q5_1
modelConf:
  - nCtx: 512
inferParams:
  - topK: 40,
  - topP: 0.1,
  - temp: 0,
  - repeatPenalty: 1
template: |-
  ### Instruction: Fix this invalid json:

  {prompt}
  ### Response: (Answer only with json)

A task is a model with it's config, some inference parameters and a template. Doc: models conf params, inference params

Run the tasks server

Command

Use the following command:

taskserver path/to/models/dir path/to/tasks/folder model_to_run-optional

Example:

taskserver /an/absolute/path/to/models/dir task open-llama-7B-open-instruct.ggmlv3.q5_1.bin

This will load the model at startup if a model name is provided

As library

Run your own server using the library:

#!/usr/bin/env node

import { argv, exit } from "process";
import { useTaskServer } from "../dist/server.js";


function _runserver(modelsDirPath, tasksDir, loadModel) {
  const { app } = useTaskServer(
    tasksDir,
    [],
    {
      modelsDirPath: modelsDirPath,
      loadModel: loadModel,
    },
    true,
  );
  app.listen(5143, () => {
    console.log("Tasks server running on port 5143");
  });
}

Parameters of useTaskServer:

  • tasksDir: string required: the directory where the tasks are
  • routes: Array<(r: Router) => void>: optional extra routes. Check the inferserver doc
  • params: InferServerParams: the server params: one is required: modelsDirPath, the path to the models directory
  • verbose: boolean: verbosity (default false)

Execute a task

Hit the /task/execute endpoint with a prompt and a task name:

curl -X POST -H "Content-Type: application/json" -d '{"prompt": "{\"a\":1,}", \
   "task": "code/json/fix"}' http://localhost:5143/task/execute