Skip to content

Instantly share code, notes, and snippets.

View Deviad's full-sized avatar

Davide P. Deviad

View GitHub Profile
@Deviad
Deviad / TOOL_SANITIZER_GUIDE.md
Last active February 14, 2026 15:19
This is to make LLM Studio work with Qwen3 Coder Next Model

Tool Parameter Sanitizer — How It Works & How to Fix Other Tools

Overview

When Claude Code sends requests through LiteLLM to non-Anthropic models (e.g. Qwen 3 Coder on LM Studio), Anthropic-specific tool definitions must be converted to OpenAI function-calling format. This conversion can produce malformed tools that the downstream model cannot use.

tool_param_sanitizer.py is a LiteLLM CustomLogger callback that intercepts requests in async_pre_call_hook and fixes tool definitions before they reach the model.


@Deviad
Deviad / dnsmasq OS X.md
Created August 9, 2025 12:03 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@Deviad
Deviad / Solution.java
Last active February 4, 2023 23:11
Cheapest Flights Within K Stops
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
/*
Fixed, clear solution which I have created after studying the problem that works in the expected time
on Leetcode and is easy to understand and remember
*/
class Solution {
@Deviad
Deviad / GetYourGuide.java
Last active January 27, 2023 18:27
Interviews in Switzerland
package com.adobe.prep;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
public class GetYourGuide {
public static void main(String[] args) {
String s = "photo.jpg, Warsaw, 2013-09-05 14:08:15\n" +
/*
This did not work because of an issue which I couldn't investigate further with the loop:
for (int i = 'a'; i < 'z'; i++) {
TrieNode child = curr.node.children.get((char) (i));
if (child != null) {
queue.offer(new Pair(curr, (char) (i), child));
}
}
I changed this in Solution2
*/
@Deviad
Deviad / BruteCollinearPoints.java
Last active May 11, 2022 17:20
Collinear Points
package week3.assignment;
import edu.princeton.cs.algs4.Queue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.stream.Collectors;
@Deviad
Deviad / CheckinsControllerSpec.groovy
Created July 14, 2021 10:53
Example of a hand made mock in micronaut
package com.projectcheckins
import com.projectcheckins.core.CheckinsRepository
import com.projectcheckins.core.UserCheckins
import io.micronaut.context.annotation.Replaces
import io.micronaut.context.annotation.Requires
import io.micronaut.core.annotation.NonNull
import io.micronaut.http.HttpRequest
import io.micronaut.http.HttpResponse
import io.micronaut.http.HttpStatus
@Deviad
Deviad / EntityAnnotationMapperSpec.groovy
Last active July 13, 2021 09:36
Micronaut Index Annotation Test
/*
* Copyright 2017-2020 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package con.worldpay.syscon;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
import com.amazonaws.services.s3.model.ObjectMetadata;
import com.amazonaws.services.s3.model.PutObjectRequest;
@Deviad
Deviad / Program.java
Last active May 6, 2021 06:36
Iterative solution to find nodes at distance k from another one
// My solution (it passes 7 tests out of 10)
import java.util.*;
class Program {
// This is an input class. Do not edit.
static class BinaryTree {
public int value;
public BinaryTree left = null;
public BinaryTree right = null;