Skip to content

Instantly share code, notes, and snippets.

@celsowm
celsowm / start_llama_cpp_server.bat
Last active May 14, 2025 01:03
start_llama_cpp_server.bat
@echo off
REM ==========================================================
REM start_llama_server.bat – Escolhe modelo .gguf por número
REM + opção mmproj/offload
REM ==========================================================
setlocal EnableDelayedExpansion
cd /d "%~dp0"
echo.
echo ==========================================================
@celsowm
celsowm / index.htm
Created May 5, 2025 02:03
auto complete metionsjs com lazy load
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Autocomplete @mentions com Lazy-Load</title>
<!-- CSS do Tribute.js -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tributejs/5.1.3/tribute.css"
@celsowm
celsowm / index.htm
Created May 5, 2025 01:52
tributejs example
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Exemplo Tribute.js Autocomplete @mentions</title>
<!-- Tribute.js CSS -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tributejs/5.1.3/tribute.css"
@celsowm
celsowm / plugin.js
Created May 5, 2025 01:42
ballon prompt plugin
import { Plugin, ButtonView, ContextualBalloon, clickOutsideHandler, View } from 'ckeditor5';
export class HelloWorldView extends View {
constructor( locale ) {
super( locale );
// Cria o template com textarea e botão
this.setTemplate( {
tag: 'div',
attributes: {
@celsowm
celsowm / error.txt
Created May 3, 2025 02:30
error sglang
[2025-05-02 23:30:03] INFO: 127.0.0.1:52812 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
[2025-05-02 23:30:03] ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/celso/.local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celso/.local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
@celsowm
celsowm / plugin.js
Created May 1, 2025 18:49
Levi CKEDITOR 5
import { Plugin, ContextualBalloon, ButtonView, InputTextView, View } from 'ckeditor5';
export default class LeviPlugin extends Plugin {
static get requires() {
return [ContextualBalloon];
}
init() {
const editor = this.editor;
@celsowm
celsowm / plugin.js
Created May 1, 2025 16:05
Translate plugin test ballon ckeditor5
import { Plugin, ButtonView, ContextualBalloon } from 'ckeditor5';
// Removed Rect import as it's for TypeScript
export default class TranslatePlugin extends Plugin {
static get requires() {
return [ContextualBalloon];
}
init() {
const editor = this.editor;
@celsowm
celsowm / levi_chat.htm
Created April 30, 2025 00:12
llm chat single page htm (LEVI CHAT)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Levi Chat</title>
<style>
body {
margin: 0;
background: #f7f7f8;
@celsowm
celsowm / index.htm
Last active April 27, 2025 21:50
LLM EDITOR
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>DOCX Editor + LLM Chat</title>
<!-- FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
@celsowm
celsowm / index.htm
Created April 24, 2025 01:26
docx to html
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Preview DOCX (docx-preview 0.3.5)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- 1) JSZip -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<!-- 2) TIFF.js (se você não precisar, pode remover) -->