Skip to content

armgit / janas

Public Imported from GitHub
0

37 tok/s from Qwen3-Next-80B (48 GB) on a 32 GB laptop, 24 without drafts vs 2.8 for llama.cpp; reading 62 vs 16 tok/s. Faster than llama.cpp on all 13 models compared in Q4_K_M. LLMs bigger than your RAM, pure C, CPU or GPU.

1.3 KB
Raw Blame
/* SPDX-License-Identifier: GPL-3.0-or-later
   Copyright (C) 2026 Maurizio Cammalleri */
/*
 * https_get.h - a GET over HTTPS (https_get.c), for Janas's services.
 */
#ifndef JANAS_COMMON_HTTPS_GET_H
#define JANAS_COMMON_HTTPS_GET_H

#include <stddef.h>

#include "llm/json.h"

struct janas_net_policy;

/* GET of url (https), following redirects, the body into out (with a 0
   after it, not counted). The HTTP status (200...), or -1 with the reason
   in err. */
int janas_https_get(const char *url, const char *const *headers,
                    size_t n_headers, struct janas_buf *out, char *err,
                    size_t err_len);
/* The same, waiting at most timeout_ms for each part of the answer
   (janas_https_get: 15 s). */
int janas_https_get_ms(const char *url, const char *const *headers,
                       size_t n_headers, int timeout_ms, struct janas_buf *out,
                       char *err, size_t err_len);
/* The same for a URL someone else gave (http too): every address it and
   its redirects resolve to checked against policy (common/mcp_policy.h),
   the connection made only to one that passed. */
int janas_https_get_policy(const char *url,
                           const struct janas_net_policy *policy,
                           int timeout_ms, struct janas_buf *out, char *err,
                           size_t err_len);

#endif