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.
03.1k
1import { inspect, InspectOptions, ParseArgsConfig } from 'node:util';2export type ParseArgsOptions = Exclude<ParseArgsConfig['options'], undefined>;3export type ParseArgsOption = ParseArgsOptions[string];4export type ParseArgsDefault = Exclude<ConfigValue, number | number[]>;5export type ConfigType = 'number' | 'string' | 'boolean';6export declare const isConfigType: (t: unknown) => t is ConfigType;7export type ConfigValuePrimitive = string | boolean | number;8export type ConfigValueArray = string[] | boolean[] | number[];9export type ConfigValue = ConfigValuePrimitive | ConfigValueArray;10/**11 * Given a Jack object, get the typeof its ConfigSet12 */13export type Unwrap<J> = J extends Jack<infer C> ? C : never;14/**15 * Defines the type of value that is valid, given a config definition's16 * {@link ConfigType} and boolean multiple setting17 */18export type ValidValue<T extends ConfigType = ConfigType, M extends boolean = boolean> = [19 T,20 M21] extends ['number', true] ? number[] : [T, M] extends ['string', true] ? string[] : [T, M] extends ['boolean', true] ? boolean[] : [T, M] extends ['number', false] ? number : [T, M] extends ['string', false] ? string : [T, M] extends ['boolean', false] ? boolean : [T, M] extends ['string', boolean] ? string | string[] : [T, M] extends ['boolean', boolean] ? boolean | boolean[] : [T, M] extends ['number', boolean] ? number | number[] : [T, M] extends [ConfigType, false] ? ConfigValuePrimitive : [T, M] extends [ConfigType, true] ? ConfigValueArray : ConfigValue;22export type ReadonlyArrays = readonly number[] | readonly string[];23/**24 * Defines the type of validOptions that are valid, given a config definition's25 * {@link ConfigType}26 */27export type ValidOptions<T extends ConfigType> = T extends 'boolean' ? undefined : T extends 'string' ? readonly string[] : T extends 'number' ? readonly number[] : ReadonlyArrays;28/**29 * A config field definition, in its full representation.30 * This is what is passed in to addFields so `type` is required.31 */32export type ConfigOption<T extends ConfigType = ConfigType, M extends boolean = boolean, O extends undefined | ValidOptions<T> = undefined | ValidOptions<T>> = {33 type: T;34 short?: string;35 default?: ValidValue<T, M> & (O extends ReadonlyArrays ? M extends false ? O[number] : O[number][] : unknown);36 description?: string;37 hint?: T extends 'boolean' ? undefined : string;38 validate?: ((v: unknown) => v is ValidValue<T, M>) | ((v: unknown) => boolean);39 validOptions?: O;40 delim?: M extends false ? undefined : string;41 multiple?: M;42};43/**44 * Determine whether an unknown object is a {@link ConfigOption} based only45 * on its `type` and `multiple` property46 */47export declare const isConfigOptionOfType: <T extends ConfigType, M extends boolean>(o: unknown, type: T, multi: M) => o is ConfigOption<T, M>;48/**49 * Determine whether an unknown object is a {@link ConfigOption} based on50 * it having all valid properties51 */52export declare const isConfigOption: <T extends ConfigType, M extends boolean>(o: unknown, type: T, multi: M) => o is ConfigOption<T, M>;53/**54 * The meta information for a config option definition, when the55 * type and multiple values can be inferred by the method being used56 */57export type ConfigOptionMeta<T extends ConfigType, M extends boolean, O extends ConfigOption<T, M> = ConfigOption<T, M>> = Pick<Partial<O>, 'type'> & Omit<O, 'type'>;58/**59 * A set of {@link ConfigOption} objects, referenced by their longOption60 * string values.61 */62export type ConfigSet = {63 [longOption: string]: ConfigOption;64};65/**66 * A set of {@link ConfigOptionMeta} fields, referenced by their longOption67 * string values.68 */69export type ConfigMetaSet<T extends ConfigType, M extends boolean> = {70 [longOption: string]: ConfigOptionMeta<T, M>;71};72/**73 * Infer {@link ConfigSet} fields from a given {@link ConfigMetaSet}74 */75export type ConfigSetFromMetaSet<T extends ConfigType, M extends boolean, S extends ConfigMetaSet<T, M>> = S & {76 [longOption in keyof S]: ConfigOption<T, M>;77};78/**79 * The 'values' field returned by {@link Jack#parse}. If a value has80 * a default field it will be required on the object otherwise it is optional.81 */82export type OptionsResults<T extends ConfigSet> = {83 [K in keyof T]: (T[K]['validOptions'] extends ReadonlyArrays ? T[K] extends ConfigOption<'string' | 'number', false> ? T[K]['validOptions'][number] : T[K] extends ConfigOption<'string' | 'number', true> ? T[K]['validOptions'][number][] : never : T[K] extends ConfigOption<'string', false> ? string : T[K] extends ConfigOption<'string', true> ? string[] : T[K] extends ConfigOption<'number', false> ? number : T[K] extends ConfigOption<'number', true> ? number[] : T[K] extends ConfigOption<'boolean', false> ? boolean : T[K] extends ConfigOption<'boolean', true> ? boolean[] : never) | (T[K]['default'] extends ConfigValue ? never : undefined);84};85/**86 * The object retured by {@link Jack#parse}87 */88export type Parsed<T extends ConfigSet> = {89 values: OptionsResults<T>;90 positionals: string[];91};92/**93 * A row used when generating the {@link Jack#usage} string94 */95export interface Row {96 left?: string;97 text: string;98 skipLine?: boolean;99 type?: string;100}101/**102 * A heading for a section in the usage, created by the jack.heading()103 * method.104 *105 * First heading is always level 1, subsequent headings default to 2.106 *107 * The level of the nearest heading level sets the indentation of the108 * description that follows.109 */110export interface Heading extends Row {111 type: 'heading';112 text: string;113 left?: '';114 skipLine?: boolean;115 level: number;116 pre?: boolean;117}118/**119 * An arbitrary blob of text describing some stuff, set by the120 * jack.description() method.121 *122 * Indentation determined by level of the nearest header.123 */124export interface Description extends Row {125 type: 'description';126 text: string;127 left?: '';128 skipLine?: boolean;129 pre?: boolean;130}131/**132 * A heading or description row used when generating the {@link Jack#usage}133 * string134 */135export type TextRow = Heading | Description;136/**137 * Either a {@link TextRow} or a reference to a {@link ConfigOption}138 */139export type UsageField = TextRow | {140 type: 'config';141 name: string;142 value: ConfigOption;143};144/**145 * Options provided to the {@link Jack} constructor146 */147export interface JackOptions {148 /**149 * Whether to allow positional arguments150 *151 * @default true152 */153 allowPositionals?: boolean;154 /**155 * Prefix to use when reading/writing the environment variables156 *157 * If not specified, environment behavior will not be available.158 */159 envPrefix?: string;160 /**161 * Environment object to read/write. Defaults `process.env`.162 * No effect if `envPrefix` is not set.163 */164 env?: Record<string, string | undefined>;165 /**166 * A short usage string. If not provided, will be generated from the167 * options provided, but that can of course be rather verbose if168 * there are a lot of options.169 */170 usage?: string;171 /**172 * Stop parsing flags and opts at the first positional argument.173 * This is to support cases like `cmd [flags] <subcmd> [options]`, where174 * each subcommand may have different options. This effectively treats175 * any positional as a `--` argument. Only relevant if `allowPositionals`176 * is true.177 *178 * To do subcommands, set this option, look at the first positional, and179 * parse the remaining positionals as appropriate.180 *181 * @default false182 */183 stopAtPositional?: boolean;184 /**185 * Conditional `stopAtPositional`. If set to a `(string)=>boolean` function,186 * will be called with each positional argument encountered. If the function187 * returns true, then parsing will stop at that point.188 */189 stopAtPositionalTest?: (arg: string) => boolean;190}191/**192 * Class returned by the {@link jack} function and all configuration193 * definition methods. This is what gets chained together.194 */195export declare class Jack<C extends ConfigSet = {}> {196 #private;197 constructor(options?: JackOptions);198 /**199 * Resulting definitions, suitable to be passed to Node's `util.parseArgs`,200 * but also including `description` and `short` fields, if set.201 */202 get definitions(): C;203 /** map of `{ <short>: <long> }` strings for each short name defined */204 get shorts(): Record<string, string>;205 /**206 * options passed to the {@link Jack} constructor207 */208 get jackOptions(): JackOptions;209 /**210 * the data used to generate {@link Jack#usage} and211 * {@link Jack#usageMarkdown} content.212 */213 get usageFields(): UsageField[];214 /**215 * Set the default value (which will still be overridden by env or cli)216 * as if from a parsed config file. The optional `source` param, if217 * provided, will be included in error messages if a value is invalid or218 * unknown.219 */220 setConfigValues(values: Partial<OptionsResults<C>>, source?: string): this;221 /**222 * Parse a string of arguments, and return the resulting223 * `{ values, positionals }` object.224 *225 * If an {@link JackOptions#envPrefix} is set, then it will read default226 * values from the environment, and write the resulting values back227 * to the environment as well.228 *229 * Environment values always take precedence over any other value, except230 * an explicit CLI setting.231 */232 parse(args?: string[]): Parsed<C>;233 loadEnvDefaults(): void;234 applyDefaults(p: Parsed<C>): void;235 /**236 * Only parse the command line arguments passed in.237 * Does not strip off the `node script.js` bits, so it must be just the238 * arguments you wish to have parsed.239 * Does not read from or write to the environment, or set defaults.240 */241 parseRaw(args: string[]): Parsed<C>;242 /**243 * Validate that any arbitrary object is a valid configuration `values`244 * object. Useful when loading config files or other sources.245 */246 validate(o: unknown): asserts o is Parsed<C>['values'];247 writeEnv(p: Parsed<C>): void;248 /**249 * Add a heading to the usage output banner250 */251 heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6, { pre }?: {252 pre?: boolean;253 }): Jack<C>;254 /**255 * Add a long-form description to the usage output at this position.256 */257 description(text: string, { pre }?: {258 pre?: boolean;259 }): Jack<C>;260 /**261 * Add one or more number fields.262 */263 num<F extends ConfigMetaSet<'number', false>>(fields: F): Jack<C & ConfigSetFromMetaSet<'number', false, F>>;264 /**265 * Add one or more multiple number fields.266 */267 numList<F extends ConfigMetaSet<'number', true>>(fields: F): Jack<C & ConfigSetFromMetaSet<'number', true, F>>;268 /**269 * Add one or more string option fields.270 */271 opt<F extends ConfigMetaSet<'string', false>>(fields: F): Jack<C & ConfigSetFromMetaSet<'string', false, F>>;272 /**273 * Add one or more multiple string option fields.274 */275 optList<F extends ConfigMetaSet<'string', true>>(fields: F): Jack<C & ConfigSetFromMetaSet<'string', true, F>>;276 /**277 * Add one or more flag fields.278 */279 flag<F extends ConfigMetaSet<'boolean', false>>(fields: F): Jack<C & ConfigSetFromMetaSet<'boolean', false, F>>;280 /**281 * Add one or more multiple flag fields.282 */283 flagList<F extends ConfigMetaSet<'boolean', true>>(fields: F): Jack<C & ConfigSetFromMetaSet<'boolean', true, F>>;284 /**285 * Generic field definition method. Similar to flag/flagList/number/etc,286 * but you must specify the `type` (and optionally `multiple` and `delim`)287 * fields on each one, or Jack won't know how to define them.288 */289 addFields<F extends ConfigSet>(fields: F): Jack<C & F>;290 /**291 * Return the usage banner for the given configuration292 */293 usage(): string;294 /**295 * Return the usage banner markdown for the given configuration296 */297 usageMarkdown(): string;298 /**299 * Return the configuration options as a plain object300 */301 toJSON(): {302 [k: string]: {303 hint?: string | undefined;304 default?: ConfigValue | undefined;305 validOptions?: readonly number[] | readonly string[] | undefined;306 validate?: ((v: unknown) => boolean) | ((v: unknown) => v is ConfigValue) | undefined;307 description?: string | undefined;308 short?: string | undefined;309 delim?: string | undefined;310 multiple?: boolean | undefined;311 type: ConfigType;312 };313 };314 /**315 * Custom printer for `util.inspect`316 */317 [inspect.custom](_: number, options: InspectOptions): string;318}319/**320 * Main entry point. Create and return a {@link Jack} object.321 */322export declare const jack: (options?: JackOptions) => Jack<{}>;323//# sourceMappingURL=index.d.ts.map