Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03k
1# flat-cache2 3> A stupidly simple key/value storage using files to persist the data4 5[](https://npmjs.org/package/flat-cache)6[](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml)7[](https://codecov.io/github/jaredwray/flat-cache)8[](https://npmjs.com/package/flat-cache)9 10## install11 12```bash13npm i --save flat-cache14```15 16## Usage17 18```js19const flatCache = require('flat-cache');20// loads the cache, if one does not exists for the given21// Id a new one will be prepared to be created22const cache = flatCache.load('cacheId');23 24// sets a key on the cache25cache.setKey('key', { foo: 'var' });26 27// get a key from the cache28cache.getKey('key'); // { foo: 'var' }29 30// fetch the entire persisted object31cache.all(); // { 'key': { foo: 'var' } }32 33// remove a key34cache.removeKey('key'); // removes a key from the cache35 36// save it to disk37cache.save(); // very important, if you don't save no changes will be persisted.38// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys39 40// loads the cache from a given directory, if one does41// not exists for the given Id a new one will be prepared to be created42const cache = flatCache.load('cacheId', path.resolve('./path/to/folder'));43 44// The following methods are useful to clear the cache45// delete a given cache46flatCache.clearCacheById('cacheId'); // removes the cacheId document if one exists.47 48// delete all cache49flatCache.clearAll(); // remove the cache directory50```51 52## Motivation for this module53 54I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make55a script that will beutify files with `esformatter` only execute on the files that were changed since the last run.56To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value`57storage was needed and Bam! this module was born.58 59## Important notes60 61- If no directory is especified when the `load` method is called, a folder named `.cache` will be created62 inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you63 might want to ignore the default `.cache` folder, or specify a custom directory.64- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references65- All the changes to the cache state are done to memory66- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module67 intentionally dumb and simple68- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call69 like: `cache.save( true /* noPrune */ )`.70 71## License72 73MIT74 75## Changelog76 77[changelog](./changelog.md)78 