New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ggml

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ggml

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

GGUF.js

Download, manage, and run Llama GGUF files easily with Faraday.dev

gguf

A Javascript library (with Typescript types) to parse metadata for GGML-based GGUF files.

Supported Architectures

  • Llama
  • MPT
  • GPTNeoX
  • GPTJ
  • GPT2
  • Bloom
  • Falcon
  • RWKV

This library goal is to be 1-to-1 with the spec. PRs welcome!

Install

yarn add gguf

or

npm install gguf

Usage

import gguf, { isLLamaMetadata } from 'gguf'

// pass in a file path, gguf.js will only load in what is needed for the metadata
// not the whole file
const { metadata, error } = await gguf('./llama2.gguf')

if (error) {
  throw error
}

// helper function to give full type safety
// see more in `src/index.ts`
if (isLLamaMetadata(metadata)) {
  console.log(`context length: ${metadata.llama.context_length}`)
}

TypeScript

Typescript is supported by default and all definitions are in src/metadataTypes

License

MIT © Ahoy Labs, Inc.

FAQs

Package last updated on 09 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts