Skip to content

Instantly share code, notes, and snippets.

View ochafik's full-sized avatar

Olivier Chafik ochafik

View GitHub Profile
@ochafik
ochafik / get_ollama_gguf.js
Last active March 30, 2025 22:10
Script to get the GGUF file from an Ollama image for use with llama.cpp's llama-server
#!/usr/bin/env node
/*
Gets the file under $OLLAMA_HOME/models/blobs/ for the application/vnd.ollama.image.model key in the manifest
- Note that metadata of modelId:modelTag is stored under $OLLAMA_HOME/models/manifests/registry.ollama.ai/library/${modelId}/${modelTag}
- You'll need to get the Jinja template from the original model using llama.cpp's scripts/get_chat_template.py script
ollama pull qwen2.5-coder:7b
llama-server -m $( ./get_ollama_gguf.js qwen2.5-coder:7b ) -fa --jinja --chat-template-file <( ./scripts/get_chat_template.py Qwen/Qwen2.5-Coder-7B-Instruct-GGUF tool_use )
Initially shared here: https://github.com/ggml-org/llama.cpp/pull/9639#issuecomment-2704208342
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@Artefact2
Artefact2 / README.md
Last active April 29, 2025 20:04
GGUF quantizations overview
@oskar456
oskar456 / wgcf.py
Last active December 20, 2024 23:13
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone [email protected]:<hash>.git     # or with ssh
@ochafik
ochafik / burkini.md
Created August 26, 2016 05:18
Opinion(Burkini été 2016): Délit de terrorisme vestimentaire passif: à qui profite la persécution religieuse?

Délit de terrorisme vestimentaire passif: à qui profite la persécution religieuse?

Toute ressemblance avec l'affaire du racolage passif serait purement fortuite.

Ne nous voilons pas la face: en matière de politique publique, ce n'est pas l'intention qui compte, ce sont les résultats.

Eh bien quid justement des intentions en jeu dans l'affaire du burkini, et des résultats probables?

Je vois grosso modo 3 profils majeurs pour nos bien-intentionnés amis anti-burkini:

@ochafik
ochafik / async_example.dart
Last active August 29, 2015 14:23
Simple example of async/await transform for Dart's dev_compiler (see https://github.com/dart-lang/dev_compiler/issues/221)
// Run with dart:
// dart async_example.dart
import 'dart:async';
f(g) async {
try {
final value = await g();
return 'Result: ' + (value + 1);
} catch (e) {
if (e == 'rethrow me') throw e;
return 'Caught: ' + e;
@cvogt
cvogt / gist:8672a3fd97bc97714822
Last active August 8, 2023 13:55
Default values for type parameters in Scala
scala> :paste
class :=[T,Q]
trait Default_:={
/** Ignore default */
implicit def useProvided[Provided,Default] = new :=[Provided,Default]
}
object := extends Default_:={
/** Infer type argument to default */
implicit def useDefault[Default] = new :=[Default,Default]
}
@damondouglas
damondouglas / Angular-Dart-Check-Lists.md
Last active April 27, 2017 06:45
Angular Dart Check Lists

Angular Dart Check List

The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.

Table Of Contents