<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anup on Medium]]></title>
        <description><![CDATA[Stories by Anup on Medium]]></description>
        <link>https://medium.com/@anupk1?source=rss-f2dec6598171------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Anup on Medium</title>
            <link>https://medium.com/@anupk1?source=rss-f2dec6598171------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:31:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anupk1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Llama cpp on HPC]]></title>
            <link>https://medium.com/@anupk1/llama-cpp-on-hpc-b935dd4a5f8a?source=rss-f2dec6598171------2</link>
            <guid isPermaLink="false">https://medium.com/p/b935dd4a5f8a</guid>
            <category><![CDATA[llama-cpp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[hpc]]></category>
            <category><![CDATA[self-hosting]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Anup]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 02:54:01 GMT</pubDate>
            <atom:updated>2026-11-27T02:54:01.439Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Note: It is assumed that the HPC uses SLURM for cluster management and job scheduling and bash shell is used.</blockquote><p>In my <a href="https://medium.com/@anupk1/ollama-on-hpc-without-sudo-3468594ea35e"><strong>previous post</strong></a>, I went over running Ollama on an HPC without sudo. This time it’s llama.cpp. Its setup now is also a few lines</p><pre>curl -LsSf https://llama.app/install.sh | sh<br>llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF     # serve a model (API)<br>llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF       # or chat with it in the terminal</pre><p>Good news is, unlike Ollama, <a href="https://llama.app/docs/installation"><strong>the installer</strong></a> does not need root access. It puts the binary in <em>~/.local/bin</em>.</p><blockquote><strong>WARNING: </strong>This is just for educational purposes. Please be responsible while using HPC resources and NEVER launch jobs on the LOGIN NODES; always comply with the placed policies. Launching compute jobs (like running llama.cpp) on a login node MIGHT GET YOU BANNED.</blockquote><p><strong>Is llama.cpp already installed?<br></strong>Some HPC clusters might already have set up llama.cpp as a module. To check:</p><pre>module spider llama</pre><p>If a version is returned, load it (the module name can differ between clusters):</p><pre>module load llama.cpp    #or whatever name the llama.cpp module has</pre><p>Virginia Tech ARC has a detailed <a href="https://docs.arc.vt.edu/ai/031_llama.cpp.html"><strong>guide</strong></a> for the case where llama.cpp is installed as a module; for any HPC with SLURM, it’s a similar process.</p><p><strong>Installing it yourself<br></strong>If not, the one-line installer works without sudo. <br>First, get a compute node (adjust partition/account for your cluster):</p><pre>srun --gres=gpu:1 --pty bash #or as per your cluster recommendation</pre><p>Then, on that node</p><pre>curl -LsSf https://llama.app/install.sh | sh</pre><p>Run the installer on the GPU/compute node, not on the login node. The installer checks the hardware of the machine it runs on and picks the matching build (CUDA, ROCm, Vulkan, or CPU as a fallback). On a login node without a GPU, you would most likely end up with the CPU build so even if GPU node is used to server, the GPU will not be used.</p><p>The binary goes to <em>~/.local/bin/llama</em>. The installer does not edit your <em>.bashrc</em>; if <em>~/.local/bin</em> is not on your PATH, it prints the line to add.</p><p><strong>Chat in the terminal vs. use the API<br></strong>This differs from Ollama. With Ollama, <em>ollama run</em> talks to the running <em>ollama serve</em>, so both are needed. But here, <a href="https://llama.app/docs/cli"><strong><em>llama cli</em></strong></a> loads the model itself, so we don’t need the server to chat in the terminal</p><pre>llama cli -hf ggml-org/Qwen3.5–0.8B-GGUF  # downloads from HF<br>llama cli -m ./models/my-model.gguf   # local GGUF file</pre><p>Here, <a href="https://llama.app/docs/serve"><strong><em>llama serve</em></strong></a> is only needed when we want to use the model through the API (Open WebUI, Python, curl, etc.).</p><blockquote>Running both (llama cli and llama server) at the same time will load the model twice on the GPU</blockquote><p>By default, <em>llama serve</em> listens on <em>127.0.0.1:9931</em> without any API key. So if the GPU node is shared, other users on the same node can reach it too. <br>So we can use an API key, but not pass it with — <em>api-key </em>flag, as users on a shared node can see command-line arguments with <em>ps </em>command as explained <a href="http://medium.com/r?url=https%3A%2F%2Fdocs.arc.vt.edu%2Fai%2F031_llama.cpp.html"><strong><em>here</em></strong></a>. We can pass the key using an env var, LLAMA_API_KEY, and keep it in a file that only the specific user can access.</p><blockquote>Please refrain from using “<em>— host 0.0.0.0” </em>on a shared cluster</blockquote><p><strong>Reaching the server from your machine</strong></p><p>As with any HPC, the actual process runs on a compute node behind the login node, so we need to open a ssh tunnel through the login node.</p><p>To open a tunnel, on a seperate terminal on personal machine we can use the following command</p><pre>ssh -J &lt;user&gt;@&lt;login-node&gt; -L 9931:localhost:&lt;port&gt; &lt;user&gt;@&lt;node&gt;</pre><p>Now our client can access the model at <a href="http://localhost:9931/v1%60">http://localhost:9931/v1</a></p><p>As in the Ollama post, while using interactive jobs, it is recommended to run the server in a tmux session so logs don’t clutter the terminal and the job keeps running if the ssh connection disconnects</p><p>Putting it all together, the whole script would be</p><pre>#!/bin/bash<br><br>SESSION=&quot;llama&quot;<br>LLAMA=&quot;$HOME/.local/bin/llama&quot;<br>KEYFILE=&quot;$HOME/.llama-api-key&quot;<br>NODE=$(hostname -s)<br><br>print_help() {<br>cat &lt;&lt;EOF<br>Usage:<br>  bash setupllama.sh --download &lt;hf-repo&gt;     # download from HF, e.g. ggml-org/Qwen3.5-0.8B-GGUF<br>  bash setupllama.sh --local &lt;file.gguf&gt;      # local GGUF file<br>  bash setupllama.sh                          # defaults to ggml-org/Qwen3.5-0.8B-GGUF<br>EOF<br>}<br><br>SRC=&quot;-hf&quot;<br>MODEL=&quot;ggml-org/Qwen3.5-0.8B-GGUF&quot;<br>case &quot;$1&quot; in<br>  --download) SRC=&quot;-hf&quot;; MODEL=&quot;$2&quot; ;;<br>  --local)    SRC=&quot;-m&quot;;  MODEL=&quot;$2&quot; ;;<br>  -h|--help)  print_help; exit 0 ;;<br>  &quot;&quot;) ;;<br>  *) echo &quot;Unknown option: $1&quot;; print_help; exit 1 ;;<br>esac<br><br>if [ -z &quot;$MODEL&quot; ]; then<br>  echo &quot;Missing model after $1&quot;; print_help; exit 1<br>fi<br>if [ &quot;$SRC&quot; = &quot;-m&quot; ]; then<br>  [ -f &quot;$MODEL&quot; ] || { echo &quot;File not found: $MODEL&quot;; exit 1; }<br>  MODEL=$(realpath &quot;$MODEL&quot;)<br>fi<br><br># check for type of job by checking terminal (batch jobs don&#39;t have one)<br>if ( : &lt; /dev/tty ) 2&gt;/dev/null; then MODE=&quot;interactive&quot;; else MODE=&quot;batch&quot;; fi<br><br># API via tunnel (used by both modes)<br>print_api_usage() {<br>cat &lt;&lt;EOF<br>    1. Get your API key (on the cluster):  cat $KEYFILE<br>    2. On a terminal on YOUR machine, open a tunnel:<br>         ssh -J &lt;user&gt;@&lt;login-node&gt; -L 9931:localhost:$PORT &lt;user&gt;@$NODE<br>    3. Point your client (Open WebUI, Python, Curl ...) to: http://localhost:9931/v1<br>       and use the key as the API key, e.g.:<br>         curl http://localhost:9931/v1/chat/completions \\<br>           -H &quot;Authorization: Bearer &lt;your-key&gt;&quot; \\<br>           -H &quot;Content-Type: application/json&quot; \\<br>           -d &#39;{&quot;model&quot;: &quot;$MODEL&quot;, &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hi!&quot;}]}&#39;<br>EOF<br>}<br><br><br># for interactive jobs<br>print_interactive_usage() {<br>cat &lt;&lt;EOF<br><br>================================================================<br> INTERACTIVE JOB on $NODE<br> Model:  $MODEL<br> Server: localhost:$PORT (tmux session: $SESSION), API key required<br>================================================================<br><br> You are on the node, so you can do EITHER of these:<br><br> A) CHAT RIGHT HERE IN THE TERMINAL (no tunnel, no server, no key needed)<br>    llama cli loads the model itself, so stop the server first<br>    (otherwise the model is loaded twice on the GPU):<br>      tmux kill-session -t $SESSION<br>    Then:<br>      $LLAMA cli $SRC $MODEL<br><br> B) USE THE API FROM YOUR MACHINE (keep the server running)<br>EOF<br>print_api_usage<br>cat &lt;&lt;EOF<br><br> Server logs:  tmux attach -t $SESSION   (detach: Ctrl-b d)<br> Stop server:  tmux kill-session -t $SESSION<br><br> NOTE: exiting this srun shell (aka terminal) or a disconnection to the node ends the job and stops everything.<br>================================================================<br>EOF<br>}<br><br># for batch jobs<br>print_batch_usage() {<br>cat &lt;&lt;EOF<br><br>================================================================<br> BATCH JOB $SLURM_JOB_ID on $NODE<br> Model:  $MODEL<br> Server: localhost:$PORT, API key required<br>================================================================<br><br> There is no terminal in a batch job, so use the API from your machine:<br>EOF<br>print_api_usage<br>cat &lt;&lt;EOF<br><br> The server runs until the job&#39;s time limit.<br> Stop it early (frees the GPU):  scancel $SLURM_JOB_ID<br>================================================================<br><br>EOF<br>}<br><br>port_in_use() { (echo &gt; &quot;/dev/tcp/127.0.0.1/$1&quot;) 2&gt;/dev/null; }<br><br>server_alive() {<br>  if [ &quot;$MODE&quot; = &quot;batch&quot; ]; then<br>    kill -0 &quot;$SERVER_PID&quot; 2&gt;/dev/null<br>  else<br>    [ &quot;$(tmux list-panes -t &quot;$SESSION&quot; -F &#39;#{pane_current_command}&#39; 2&gt;/dev/null)&quot; = &quot;llama&quot; ]<br>  fi<br>}<br><br># wait until the model is loaded, then a request without the key must get 401<br>verify_key() {<br>  echo &quot;Waiting for $MODEL to download/load (first time can take a while) ...&quot;<br>  sleep 2<br>  until curl -sf -o /dev/null &quot;http://127.0.0.1:$PORT/health&quot;; do<br>    server_alive || { echo &quot;ERROR: server stopped. Check the logs.&quot;; return 1; }<br>    sleep 5<br>  done<br>  code=$(curl -s -o /dev/null -w &#39;%{http_code}&#39; -X POST \<br>    -H &quot;Content-Type: application/json&quot; -d &#39;{}&#39; \<br>    &quot;http://127.0.0.1:$PORT/v1/chat/completions&quot;)<br>  if [ &quot;$code&quot; = &quot;401&quot; ]; then<br>    echo &quot;Model loaded. API key check: OK&quot;<br>    return 0<br>  fi<br>  echo &quot;ERROR: server answered without an API key (HTTP $code). Stopping it.&quot;<br>  return 1<br>}<br><br># server already running in this interactive session: just show how to use it<br>if [ &quot;$MODE&quot; = &quot;interactive&quot; ] &amp;&amp; tmux has-session -t &quot;$SESSION&quot; 2&gt;/dev/null; then<br>  PORT=$(tmux show-environment -t &quot;$SESSION&quot; LLAMA_PORT 2&gt;/dev/null | cut -d= -f2)<br>  SRC=$(tmux show-environment -t &quot;$SESSION&quot; LLAMA_SRC 2&gt;/dev/null | cut -d= -f2)<br>  MODEL=$(tmux show-environment -t &quot;$SESSION&quot; LLAMA_MODEL 2&gt;/dev/null | cut -d= -f2-)<br>  print_interactive_usage<br>  exit 0<br>fi<br><br>echo &quot;Current node: $NODE ($MODE)&quot;<br><br># check for node; should work for most clusters (as we just use the hostname for the check)<br>ON_COMPUTE=0<br>if [ -n &quot;$SLURM_JOB_ID&quot; ] &amp;&amp; [ -n &quot;$SLURM_JOB_NODELIST&quot; ]; then<br>  if scontrol show hostnames &quot;$SLURM_JOB_NODELIST&quot; 2&gt;/dev/null | grep -qx &quot;$NODE&quot;; then<br>    ON_COMPUTE=1<br>  fi<br>fi<br><br># bypass (if the above returns FP); batch jobs can&#39;t answer a prompt, so they just stop<br>if [ &quot;$ON_COMPUTE&quot; -eq 0 ]; then<br>  echo &quot;WARNING: &#39;$NODE&#39; does not look like a compute node of a Slurm job.&quot;<br>  echo &quot; Running LLMs/heavy workloads on a login node most likely will get you banned.&quot;<br>  echo &quot; Please get a compute node first, e.g.: srun --gres=gpu:1 --pty bash&quot;<br>  if [ &quot;$MODE&quot; = &quot;batch&quot; ]; then<br>    echo &quot;Aborted.&quot;; exit 1<br>  fi<br>  printf &quot;Not on Login Node/Continue Anyways? [y/N] &quot;<br>  read -r ans &lt; /dev/tty<br>  case &quot;$ans&quot; in<br>    y|Y) ;;<br>    *) echo &quot;Aborted.&quot;; exit 1 ;;<br>  esac<br>fi<br><br>if [ &quot;$MODE&quot; = &quot;interactive&quot; ] &amp;&amp; ! command -v tmux &gt;/dev/null 2&gt;&amp;1; then<br>  echo &quot;tmux not found. Try: module load tmux&quot;<br>  exit 1<br>fi<br><br># get precompiled to ~/.local/bin. The installer picks CUDA/ROCm/Vulkan/CPU for THIS node.<br>if [ ! -x &quot;$LLAMA&quot; ]; then<br>  echo &quot;Installing llama.cpp ...&quot;<br>  curl -LsSf https://llama.app/install.sh | sh || { echo &quot;Install failed.&quot;; exit 1; }<br>fi<br><br># delete this to get new key (if needed)<br>if [ ! -s &quot;$KEYFILE&quot; ]; then<br>  (umask 077; cat /proc/sys/kernel/random/uuid &gt; &quot;$KEYFILE&quot;)<br>fi<br>chmod 600 &quot;$KEYFILE&quot;<br><br># if taken use another port<br>PORT=9931<br>while port_in_use &quot;$PORT&quot;; do PORT=$((PORT + 1)); done<br><br>if [ &quot;$MODE&quot; = &quot;batch&quot; ]; then<br>  LLAMA_API_KEY=$(cat &quot;$KEYFILE&quot;) &quot;$LLAMA&quot; serve &quot;$SRC&quot; &quot;$MODEL&quot; --host 127.0.0.1 --port &quot;$PORT&quot; &amp;<br>  SERVER_PID=$!<br>  verify_key || { kill &quot;$SERVER_PID&quot; 2&gt;/dev/null; exit 1; }<br>  print_batch_usage<br>  wait &quot;$SERVER_PID&quot;<br>else<br>  # interactive: use TMUX (no log pollution)<br>  tmux new-session -d -s &quot;$SESSION&quot;<br>  tmux set-environment -t &quot;$SESSION&quot; LLAMA_PORT &quot;$PORT&quot;<br>  tmux set-environment -t &quot;$SESSION&quot; LLAMA_SRC &quot;$SRC&quot;<br>  tmux set-environment -t &quot;$SESSION&quot; LLAMA_MODEL &quot;$MODEL&quot;<br>  tmux send-keys -t &quot;$SESSION&quot; &quot;LLAMA_API_KEY=\$(cat &#39;$KEYFILE&#39;) &#39;$LLAMA&#39; serve $SRC &#39;$MODEL&#39; --host 127.0.0.1 --port $PORT&quot; C-m<br>  verify_key || { tmux kill-session -t &quot;$SESSION&quot;; exit 1; }<br>  print_interactive_usage<br><br>  # start by srun (srun --pty bash setupllama.sh ...): the job ends with script<br>  if [ &quot;$(ps -o comm= -p &quot;$PPID&quot;)&quot; = &quot;slurmstepd&quot; ]; then<br>    echo &quot; Type &#39;exit&#39; to end the job.&quot;<br>    exec bash -i &lt; /dev/tty<br>  fi<br>fi</pre><p>Want a one-liner to download and run (inside the node)?</p><pre>curl -fsSL https://raw.githubusercontent.com/akhanal47/blog-codes/refs/heads/main/llamacpphpc/setupllamacpp.sh | bash -s -- --download ggml-org/Qwen3.5-0.8B-GGUF</pre><p>Want a one-liner to download and run (in interactive job)?</p><pre>srun --gres=gpu:1 --pty bash -c &quot;curl -fsSL https://raw.githubusercontent.com/akhanal47/blog-codes/refs/heads/main/llamacpphpc/setupllamacpp.sh| bash -s -- --download ggml-org/Qwen3.5-0.8B-GGUF&quot;</pre><p>Example to download and run (batch job)?</p><pre>#!/bin/bash<br>#SBATCH --job-name=llamacpp<br>#SBATCH --partition=gpu            # check available partitions: sinfo<br>#SBATCH --gres=gpu:volta:1         # gpu:&lt;type&gt;:&lt;count&gt;; type decides GPU memory, check: sinfo -o &quot;%P %G %f&quot;<br>#SBATCH --nodes=1<br>#SBATCH --cpus-per-task=24         # CPU cores; adjust as per available and needed<br>#SBATCH --mem=0                    # node RAM; 0 means all avaiable<br>#SBATCH --time=47:59:59            <br>#SBATCH -o llamacpp_%j.out         <br>#SBATCH -e llamacpp_%j.err         <br>##SBATCH --exclusive               # makes job exclusive (aka no one else can use this node)<br><br>curl -fsSL https://raw.githubusercontent.com/akhanal47/blog-codes/refs/heads/main/llamacpphpc/setupllamacpp.sh| bash -s -- --download ggml-org/Qwen3.5-0.8B-GGUF</pre><p>Want a one-liner to download and run (in batch job)?</p><pre>sbatch --gres=gpu:1 --time=02:00:00 --wrap=&quot;curl -fsSL https://raw.githubusercontent.com/akhanal47/blog-codes/refs/heads/main/llamacpphpc/setupllamacpp.sh| bash -s -- --download ggml-org/Qwen3.5-0.8B-GGUF&quot;</pre><p><strong>Useful Resources</strong></p><p><a href="https://llama.app/docs/introduction">Llama.app Docs</a><br><a href="https://llama.app/docs/serve">Running a server</a><br><a href="https://docs.arc.vt.edu/ai/031_llama.cpp.html">Virginia Tech’s llama.cpp Guide</a><br><a href="https://vikingdocs.york.ac.uk/applications/llama_cpp.html">University of York’s Guide</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b935dd4a5f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-Hosting Overleaf Community with Full TeX Live (Save $199/year?)]]></title>
            <link>https://medium.com/@anupk1/self-hosting-overleaf-community-edition-with-full-tex-live-79dd0e4196f6?source=rss-f2dec6598171------2</link>
            <guid isPermaLink="false">https://medium.com/p/79dd0e4196f6</guid>
            <category><![CDATA[self-hosting]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[cloudflare-tunnel]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[latex]]></category>
            <dc:creator><![CDATA[Anup]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 22:46:14 GMT</pubDate>
            <atom:updated>2026-10-17T22:55:28.856Z</atom:updated>
            <content:encoded><![CDATA[<p>With ever-decreasing compile time (as of 17-Oct-2026, it is limited to 10s), on the free tier of Overleaf, compiling projects is getting harder if your institution does not provide a paid tier. Paying <strong>$199/year</strong> for a LaTeX editor is outrageous; <strong>doesn’t matter what “features” it provides</strong> if you just use it here and there, so why not host it locally (pro: you can set compile time as long as you like; also, the machine you are hosting will likely be better spec than whatever resource Overleaf provides, so compile time would even be shorter)</p><p>The following steps are to set up Overleaf Community Edition on your own machine using the official Overleaf Toolkit and a setup script. The script configures Overleaf, picks a working MongoDB version, sets a longer compile timeout, and installs the full TeX Live distribution. You can run it locally or expose it to the internet through a Cloudflare Tunnel.</p><p><strong>Requirements<br></strong>- A Linux machine (x86–64 recommended; works on Mac; windows: IDK)<br>- Docker and Git installed<br>- About 15 GB of free disk space<br>- A Cloudflare account with a domain (only for public access)</p><p><em>Note: </em>If both your host and access machine are in the same network, it&#39;s easier to use an SSH tunnel, as you’ll not be limited by the 100s connection timeout of Cloudflare (instructions later)</p><p><strong><em>Too long, don’t want to read, and do it now?</em></strong></p><pre>curl -fsSL https://raw.githubusercontent.com/akhanal47/blog-codes/refs/heads/main/local-overleaf/localoverleaf.sh | sh</pre><p><strong>Step 1: Get the Script</strong></p><ul><li>Go to: <a href="https://github.com/akhanal47/blog-codes/blob/main/local-overleaf/localoverleaf.sh">https://github.com/akhanal47/blog-codes/blob/main/local-overleaf/localoverleaf.sh</a>, download the script</li><li>Run: chmod +x setup-overleaf.sh</li></ul><p><strong>Step 2: Create a Cloudflare Tunnel (if you really want it)</strong></p><ul><li>Open the Cloudflare Zero Trust dashboard.</li><li>Go to Networks → Tunnels and click Create a tunnel.</li><li>Choose Cloudflared and give the tunnel a name.</li><li>Copy the tunnel token (the long string after ` — token`).</li><li>Add a Public Hostname as your wish and domain, in the URL section add <a href="http://sharelatex/">http://sharelatex:80</a></li><li>Save the tunnel.</li></ul><p><strong>Step 3: Run the saved script</strong></p><p>For access on your own machine only: <br>./setup-overleaf.sh local --full-texlive</p><p>For public URL through cloudflare:</p><p>./setup-overleaf.sh cloudflared --hostname &lt;whatever domain you set in #2&gt; --tunnel-token &lt;your-token&gt; --full-texlive</p><blockquote><strong>Note</strong>: The full TeX Live installation may take 30 to 60 minutes, based on your network.</blockquote><blockquote>If your are over SSH, run the script inside “tmux” or “screen” to keep the process even if your SSH connection is broken down</blockquote><p><strong>Step 4: Create the admin account</strong></p><ul><li>Open <a href="http://localhost/">http://localhost</a>/launchpad (local) or https://&lt;your URL&gt;/launchpad (public)</li><li>Register your admin account (admin will be able to control access for other users)</li><li>Login at <a href="http://localhost/">http://localhost</a>/login (local) or https://&lt;your URL&gt;/login (public)</li></ul><p>That’s it. Export the project that is failing to compile on the Overleaf free plan, write something new, or do as you please.</p><p><strong>Some Notable Commands</strong></p><pre>bin/stop          # stop Overleaf<br>bin/start         # start Overleaf<br>bin/logs -f web   # follow the web logs<br>bin/doctor        # check the installation</pre><p><strong>Other Notes &amp; Cloudflare Limit</strong></p><ul><li>The compile timeout is set to 600 seconds; if needed more change it with --compile-timeout args while installing</li><li>Cloudflare stops any single request after about 100 seconds, so very long compiles return a 524 error over the public URL. See the section below for a workaround.</li><li>Community Edition does not isolate compiles from the server. <strong>Create accounts only for people you trust.</strong></li></ul><p><strong>Longer Compile Time (Cloudflare Limit Workaround)</strong></p><p>If your hosting and editing machine (aka the machine you use to access the UI) are different, which is pretty much sure if you’re interested in exposing it to a URL, Cloudlfare has a limit of 100s for request time which prevent truely “long” compiles.</p><p>We can use an SSH tunnel as a workaround for the 100s limit. B<strong>ut both machines MUST be on the same network, and your hosting machine MUST be configured for tunneling.</strong></p><ul><li>Find the server’s local IP address by running this on the server: hostname -I</li><li>On your user machine (aka where you want the UI to open), open the tunnel and keep the terminal open: ssh -N -L 8080:127.0.0.1:80 &lt;your-host-machine-username&gt;@&lt;host-ip&gt;</li><li>Open <a href="http://localhost/">http://localhost</a>:8080 on the user machine</li><li>Log in with your Overleaf account.</li></ul><p><strong>What if I want &gt;100s compile time when using across different networks (aka the host and user are on different networks)?</strong></p><ul><li>Suggested to use <a href="https://tailscale.com/">Tailscale</a></li></ul><blockquote>P.S.: there are other settings that could be configured for a smaller collaboration (such as adding admin email on the UI so the user can ask for permission to be added instead of manually addind each user), but these are the bare bones of it</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79dd0e4196f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Bollywood centering its subjects in its songs?]]></title>
            <link>https://medium.com/@anupk1/is-bollywood-slowly-centering-its-subjects-in-its-songs-a87fdaa2302b?source=rss-f2dec6598171------2</link>
            <guid isPermaLink="false">https://medium.com/p/a87fdaa2302b</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[entertainment]]></category>
            <category><![CDATA[face-recognition]]></category>
            <category><![CDATA[movies]]></category>
            <category><![CDATA[bollwyood]]></category>
            <dc:creator><![CDATA[Anup]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 06:21:25 GMT</pubDate>
            <atom:updated>2026-08-19T03:39:03.990Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometime back, I read somewhere that <em>newer</em> Bollywood movie song videos are being framed in such a way that the “subject” stays in the center, making them easier to crop and share as Reels or TikToks (you name it) optimized for viewing on tall screens.</p><p>So, let’s do some shoddy science/experiments to test that claim</p><p><em>TLDR: It doesn’t appear to be so</em></p><p><strong>Methodology</strong></p><p>One simple way to test the hypothesis would be to check the location of faces in the frame taken at some interval (15 seconds) for a video, repeat that for some n-videos (10 for today) for a given relative “era”, and stack those data to get a single image to show the average for that era.</p><p><strong>Why is this shoddy?</strong></p><p>Out of many many glaring issues in this process, we can clearly and objectively see a few</p><p>First, it doesn’t consider focus on the “subject” or simply say Depth of Field (DOF) data at all; if the face recognition system identifies background faces (e.g., item songs tend to have a lot of background dancers distributed across the frame, but the “subject” may still be at the center of the frame, this will skew the end stacked result)</p><p>Second, the result will massively vary based on the interval in which frames are evaluated and the model being used</p><p>But this isn’t a scientific paper, so shoddy science would be fine</p><p><strong>Datasets</strong></p><p>10 videos each across two different “eras”, one from the 1990s and one post-2025 beyond — where reels, and vertical screen content consumption clearly rule. Out of 10, 3 would be what would be categorized as “item” songs (at least according to me), and the rest would be run-of-the-mill songs</p><p><strong>How were those 10 videos selected?</strong></p><p>Well, whatever the first web result (not the AI summary) Google gave when queried to get the “<em>top 10 popular Bollywood songs in ….</em>”</p><p>Now, the main thing: are there any vast differences in the stacked heatmaps?</p><p>Let’s see the heatmap in the 1990s videos</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LxwcyYx-9LDUKwCWe9ceFg.png" /><figcaption>Fig1: Heatmap for Faces Occurance 1990s “era”</figcaption></figure><p>The faces are distributed throughout the frame.</p><p>Let’s also check the heatmap from post 2025 “era”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNDCVGWI0brMS3Nd2eq0LQ.png" /><figcaption>Fig2: Heatmap for Faces Occurance post 2025 “era”</figcaption></figure><p>A simple observation shows that there is no meaningful difference in the center. However, the newer videos do appear to have more faces on the edges (well marginally more), but I believe this can be attributed to the advancements in optics and cameras used, as those used in the 1990s really struggled with softness and other optical imperfections in the corners, but since that is not the case anymore, the DOPs might be far more willing to put faces in corners &amp; edges.</p><blockquote>Was this a waste of time?<br>Yes</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a87fdaa2302b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ollama on HPC without SUDO]]></title>
            <link>https://medium.com/@anupk1/ollama-on-hpc-without-sudo-3468594ea35e?source=rss-f2dec6598171------2</link>
            <guid isPermaLink="false">https://medium.com/p/3468594ea35e</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[hpc]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[llm-applications]]></category>
            <dc:creator><![CDATA[Anup]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 04:08:16 GMT</pubDate>
            <atom:updated>2026-01-03T08:50:59.394Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Note: It is assumed that the HPC uses SLURM for cluster management and job scheduling</blockquote><p>At present, Ollama is one of the most popular, if not the most popular, way that allows anyone to chat with LLMs locally. It’s really simple to set up and start running a LLM. In fact, if the machine is capable and you have the right permissions, it’s just 3 simple steps</p><pre>curl -fsSL https://ollama.com/install.sh | sh<br>ollama serve<br>ollama run gemma2 #runs gemma2 model</pre><p>But all of us are not GPU rich and sometimes we do want to play with some fancy new large models. Here, access to HPC comes in handy.</p><blockquote><strong><em>WARNING</em>:</strong> This is just for education purpose. Please be responsible while using HPC resources and <strong>NEVER</strong> lauch jobs on the <strong>LOGIN NODES; always comply with the placed policies</strong>. <strong>Launching compute jobs (like using ollama) in login node MIGHT GET YOU BANNED.</strong></blockquote><p>While the installation process is simple, it still requires SUDO access to set up the environment, which is generally never provided to users.</p><p>Some HPC admins might already have set up Ollama on their system; To check if your system already has Ollama, you can use;</p><pre>module spider &#39;oll&#39;</pre><p>If a version of ollama is returned, ollama is installed, and you can run the ollama using</p><pre>module load ollama # or whatever name name ollama module has</pre><p>The University of Twente has a guide for the cases when Ollama is installed as a module <a href="https://hpc.wiki.utwente.nl/eemcs-hpc%3Aollama"><strong><em>here</em></strong></a>; for any HPC with SLURM, it’s a similar process.</p><p>If not, we can download the prebuilt binary and directly extract it onto a directory named “ollama” in the current working directory, which can be done directly from CLI using the following commands. The binary file is based on CPU architecture. For x86 arch:</p><pre>curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz<br>mkdir -p ollama<br>tar -C ollama -xzvf ollama-linux-amd64.tgz<br>./ollama/bin/ollama serve</pre><p>For ARM arch:</p><pre>curl -L https://ollama.com/download/ollama-linux-arm64.tgz -o ollama-linux-arm64.tgz<br>mkdir -p ollama<br>tar -C ollama -xzvf ollama-linux-arm64.tgz<br>./ollama/bin/ollama serve</pre><p>To check if ollama is running in a separate terminal</p><pre>./ollama/bin/ollama --version</pre><p>As we need two separate terminals to serve and run models, I would recommend running the serve command inside a tmux session. Yes, we can run the serve command in the background (using ‘&amp;’ at the end of serve command), but as of this writing, Ollama still outputs logs into the terminal, which clutters the model response and Ollama logs.</p><p>The whole script would be:</p><pre>#!/bin/bash<br><br>ARCHTYPE=$(uname -m)  #get the arch type<br>if tmux has-session -t ollama 2&gt;/dev/null; then<br>  tmux attach-session -t ollama<br>else<br>  tmux new-session -d -s ollama<br>  if [ &quot;$ARCHTYPE&quot; = &quot;x86_64&quot; ]; then<br>    if [ ! -f ollama-linux-amd64.tgz ]; then<br>      tmux send-keys -t ollama &quot;curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz&quot; C-m<br>    fi<br>  elif [ &quot;$ARCHTYPE&quot; = &quot;arm64&quot; ]; then<br>    if [ ! -f ollama-linux-arm64.tgz ]; then<br>      tmux send-keys -t ollama &quot;curl -L https://ollama.com/download/ollama-linux-arm64.tgz -o ollama-linux-arm64.tgz&quot; C-m<br>    fi<br>  else<br>    if [ ! -f ollama-linux-amd64.tgz ]; then<br>      tmux send-keys -t ollama &quot;curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz&quot; C-m<br>    fi<br>  fi<br>  tmux send-keys -t ollama &quot;mkdir -p ollama&quot; C-m<br>  if [ &quot;$ARCHTYPE&quot; = &quot;arm64&quot; ]; then<br>      tmux send-keys -t ollama &quot;tar -C ollama -xzvf ollama-linux-arm64.tgz&quot; C-m<br>      tmux send-keys -t ollama &quot;./ollama/bin/ollama serve&quot; C-m<br>  else<br>      tmux send-keys -t ollama &quot;tar -C ollama -xzvf ollama-linux-amd64.tgz&quot; C-m<br>      tmux send-keys -t ollama &quot;./ollama/bin/ollama serve&quot; C-m<br>  fi<br>  tmux attach-session -t ollama<br>fi</pre><p>In true Ollama fashion, you can directly run this as well</p><pre>curl -fsSL https://raw.githubusercontent.com/akhanal47/hpcstuffs/refs/heads/main/ollamasetup/setupollama.sh | sh</pre><p>Update 1: The University of Washington’s guide to installing ollama in a container and managing resources can be found <a href="https://hyak.uw.edu/docs/gpus/ollama_setup/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3468594ea35e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Want to Install Apptainer on a Linux System?]]></title>
            <link>https://medium.com/@anupk1/want-to-install-apptainer-on-a-linux-system-3f04d3f442c7?source=rss-f2dec6598171------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f04d3f442c7</guid>
            <category><![CDATA[apptainer]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[high-performace-computing]]></category>
            <dc:creator><![CDATA[Anup]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 05:48:54 GMT</pubDate>
            <atom:updated>2025-01-29T05:48:54.719Z</atom:updated>
            <content:encoded><![CDATA[<p>Apptainer (previously known as Singularity) is the most common container system for HPC. It is equivalent to Docker but used in HPC clusters to create, launch, and manage containerized environments.</p><h4>So, how do you install Apptainer?</h4><ol><li>Apptainer is not natively available on Linux and needs to be installed.</li><li>To install Apptainer on Linux, a Namespace privilege is required.</li></ol><p><strong><em>To check for namespace privileges on Ubuntu and Debian distros</em></strong></p><pre>grep -q ‘kernel.unprivileged_userns_clone=1’ /etc/sysctl.d/90-unprivileged_userns.conf &amp;&amp; \<br> echo “User namespaces enabled, continue the Apptainer installation” || \<br> echo “User namespaces NOT enabled, your use of Apptainer will be very limited”</pre><p><strong><em>If namespace is NOT enabled, use the following command to enable it</em></strong></p><pre>sudo sh -c ‘echo kernel.unprivileged_userns_clone=1 \<br> &gt;/etc/sysctl.d/90-unprivileged_userns.conf’<br> sudo sysctl -p /etc/sysctl.d/90-unprivileged_userns.conf</pre><p>Once enabled, run the following command to install a pre-build Apptainer; this is the easiest way, as the script handles the dependencies required but are not present on Linux Systems.</p><pre>curl -s https://raw.githubusercontent.com/apptainer/apptainer/main/tools/install-unprivileged.sh | \<br> bash -s -install-dir</pre><p>On running the above command, if rpm2cpio not found error appears, follow the given link to install rpm2cpio on the relevant system.<br>https://command-not-found.com/rpm2cpio</p><p>In the above script, install-dir is where the apptainer executable is to be saved.</p><p><strong><em>To check if the installation was successful:</em></strong></p><pre>./&lt;install-dir&gt;/bin/apptainer --version</pre><p>If everything went smoothly, the above command should display the current apptainer version.</p><blockquote><strong>Note:</strong></blockquote><p><em>This guide should work for Fedora, Debian, and Ubuntu with SUDO access.</em></p><p><em>Please refer to the below-mentioned installation guides for other systems including Windows and Mac.</em></p><ul><li><a href="https://hsf-training.github.io/hsf-training-singularity-webpage/setup.html#:~:text=You%20will%20need%20a%20Linux,MacOS%20is%20not%20supported.">HSF Singularity Training (Installation on Ubuntu)</a></li><li><a href="https://apptainer.org/docs/admin/main/user_namespace.html#user-namespace-requirements">Official Apptainer Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f04d3f442c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>