Obsidian ãã Ollama ãå©ç¨ã§ãã Local GPT ãã©ã°ã¤ã³ãç´¹ä»ãã¾ãã
æ´æ°å±¥æ´ï¼
- 2024.12.07: æ¨å¥¨åãè¾¼ã¿ã¢ãã«ã BGE-M3 ã«å¤æ´
ç®æ¬¡
æ¦è¦
Obsidianã¯ãç¥è管çã®ããã® Markdown ã¨ãã£ã¿ã§ããå ¥å㯠WYSIWYG åããã¦ã¯ãã¾ããããã¬ã³ããªã³ã°ã¯ã¤ã³ã©ã¤ã³ã§è¡ããã¾ãã
Obsidian ã®åç¨å©ç¨ã«ã¯ã©ã¤ã»ã³ã¹å¥ç´ãå¿ è¦ã§ãã詳細ã¯ä»¥ä¸ãåç §ãã¦ãã ããã
Local GPT ã¯ãç·¨éä¸ã®ããã¹ãå ã« LLM ã®çæçµæãåãè¾¼ããã¨ãã§ãããã©ã°ã¤ã³ã§ããOllama ã«ã対å¿ãã¦ãã¾ãã
ã¢ãã«
Ollama ãã¤ã³ã¹ãã¼ã«ãã¦ãå©ç¨ããã¢ãã«ããç¨æãã ãããå®ç¨çãªé度ã§å©ç¨ã§ãããã©ããã¯ç°å¢ã«ãã£ã¦ç°ãªããããããã¤ã試ãã¦æé©ãªã¢ãã«ãé¸ã¶å¿ è¦ãããã¾ãã
ã¢ãã«ã®ãµã¤ãºã¯ B ã¨ããåä½ã«ãããã©ã¡ã¼ã¿ã¼æ°ã§è¡¨ããã¾ãã1B 㯠10 åãã©ã¡ã¼ã¿ã¼ã§ãããã©ã¡ã¼ã¿ã¼æ°ã大ãããªãã»ã©è¯ãåçãå¾ããã¾ãããå¦çé度ãé ããªããå¿ è¦ãªã¡ã¢ãªéãå¢å¤§ãã¾ãã
ç®å®ã¨ãã¦ãVRAM ã 12GB ç©ãã ã°ã©ãã£ãã¯ãã¼ããããã° 8B ãå¿«é©ã«åãã¾ããããã以ä¸ã®ãµã¤ãºã¯ 16GB 以ä¸ãå¿ è¦ã¨ãªãã¾ãããã®ãããªã°ã©ãã£ãã¯ãã¼ãããªãç°å¢ã§ã¯ã2B ã¢ãã«ãæ¨å¥¨ãã¾ãã
M1 以éã® Mac ã¯ã¡ã¤ã³ã¡ã¢ãªã VRAM ã¨ãã¦å©ç¨ãã UMA ã¢ã¼ããã¯ãã£ã®ãããç®å®æ¹æ³ãç°ãªãã¾ããç®å®ã¨ãã¦ãã¡ã¢ãª 16GB ã§ã¯ 8Bããããããµã¤ãºã®å¤§ããã¢ãã«ã§ã¯ 32GB 以ä¸ãå¿ è¦ã¨ãªãã¾ãã
å®éã«è©¦ãã¦ã使ç¨æãè¯å¥½ã ã£ãã¢ãã«ãç´¹ä»ãã¾ããã¢ãã«ã®ãã¦ã³ãã¼ãã«å¿ è¦ãªã³ãã³ããä»è¨ãã¾ãã
Aya Expanse: åç¨å©ç¨ä¸å¯ã使ç¨æãè¯å¥½ã§ã32B 㯠GPT-3.5 ã¨åçããã以ä¸ã
32B:ollama pull hf.co/bartowski/aya-expanse-32b-GGUF:IQ2_S
8B:ollama pull aya-expanse
â» ã¢ãã«ã®ã©ã¤ã»ã³ã¹ã¯ Obsidian ã®ã©ã¤ã»ã³ã¹ã¨ã¯å¥ã§ããåç¨å©ç¨ã«ã¯éçºå ã® Cohere 社ã«åãåããã¦ãå¥ç´ãå¿ è¦ã§ããï¼éåç¨ãªãä¸è¦ï¼Tanuki-8B-dpo-v1.0: åç¨å©ç¨å¯ãæ¥æ¬ã§éçºãããã¢ãã«ã§ãèªç¶ãªæ¥æ¬èªãçæããã¼ã¯ãã¤ã¶ã¼ã«å¶éããããå ¨è§è±æ°åãåè§ã«ãã®å ¥åã¯ä¸å¯ãðåç §
8B:ollama pull 7shi/tanuki-dpo-v1.0
Gemma 2 Baku 2B: åç¨å©ç¨å¯ãGoogle 社ãéçºããã¢ãã«ã rinna 社ãæ¥æ¬èªç¶ç¶äºåå¦ç¿ã
2B:ollama pull lucas2024/gemma-2-baku-2b-it:q8_0
â» ãªãªã¸ãã«ã® Gemma 2 ã«ã¯ 9B 㨠27B ãããã¾ãããæ¥æ¬èªã§å©ç¨ããã«ã¯ Local GPT ã®ããã³ãããæ¥æ¬èªåããå¿ è¦ããããããæ¬è¨äºã§ã¯å²æãã¾ãã
åãè¾¼ã¿ã¢ãã«
RAG æ©è½ãå©ç¨ããã«ã¯åãè¾¼ã¿ã¢ãã«ãå¿ è¦ã§ãã
æ¥æ¬èªãå«ãå¤è¨èªå¯¾å¿ã® BGE-M3 ãæ¨å¥¨ãã¾ãã
ollama pull bge-m3
Local GPT ã®ã¤ã³ã¹ãã¼ã«
Obsidian 㨠Ollama ã¯æ¢ã«ã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ãåæã¨ãã¦ãæ¬è¨äºã§ã¯ Local GPT ãã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã«æé ã解説ãã¾ãã
å·¦ã®ãµã¤ãããã«ãæãããã¾ãã¦ããå ´åãå±éãã¾ãã
å·¦ã®ãµã¤ãããã«ã®ä¸é¨ã«ããæ¯è»ã¢ã¤ã³ã³ãã¯ãªãã¯ãã¾ãã
ãã³ãã¥ããã£ãã©ã°ã¤ã³ããé¸æãã¦ãç¡å¹åããã¦ããã°æå¹åãã¾ãã
ãé²è¦§ããã¯ãªãã¯ãã¾ãã
ãgptãã§æ¤ç´¢ãã¦ãLocal GPT ãé¸æãã¾ãã
ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¦æå¹åãããªãã·ã§ã³ãéãã¾ãã
Selected AI provider 㧠Ollama ãé¸æãã¦ã使ç¨ããã¢ãã«ãé¸æãã¾ãã
ãã³ãã¥ããã£ãã©ã°ã¤ã³ããé¸æãã¦ãLocal GPT ã® â ãã¼ã¯ãã¯ãªãã¯ãã¾ãã
ãLocal GPT: Show context menuãã«é©å½ãªã·ã§ã¼ãã«ãããå²ãå½ã¦ã¾ããï¼ä»¥ä¸ã®ã¹ã¯ãªã¼ã³ã·ã§ããã§ã¯ Cursor ã¨ãã£ã¿ãæèã㦠Ctrl+K ã¨ãã¦ãã¾ãï¼
以ä¸ã§ãã©ã°ã¤ã³ã®æºåã¯å®äºã§ãã
使ç¨æ¹æ³
Local GPT ã¯ãã£ããæ¬ãåé¢ããã¦ããããããã¹ãå ã§ç´æ¥ AI ã«ããæç« ãçæããããã«è¨è¨ããã¦ãã¾ãã
使ç¨ããã«ã¯ãã¾ãããã¹ããé¸æãï¼æªé¸æã®å ´åã«ã¤ãã¦ã¯å¾è¿°ï¼ãè¨å®ããã·ã§ã¼ãã«ãããã¼ï¼ä¾ï¼Ctrl+Kï¼ãæ¼ãã¦ã³ã³ããã¹ãã¡ãã¥ã¼ã表示ãã¾ãããã®ã¡ãã¥ã¼ãããç®çã«å¿ããé©åãªã¢ã¯ã·ã§ã³ãé¸æãããã¨ã§ãé¸æç®æã®ç´å¾ã« AI ãããã¹ããçæãã¾ãã
â» é¸æç®æã«ãªã³ã¯ãå«ã¾ããå ´åãç¹å¥ãªå¦çãè¡ããã¾ãã詳細ã¯å¾è¿°ãã¾ãã
æ¨æºã¢ã¯ã·ã§ã³
Local GPT ã¯ä»¥ä¸ã®æ¨æºã¢ã¯ã·ã§ã³ãæä¾ãã¾ãã
⨠General helpï¼æ±ç¨æ¯æ´ï¼
é¸æããããã¹ãã®æèã«æ²¿ã£ã¦æ°ããå 容ãçæãã¾ãããã£ã¨ãåºæ¬çãªã¢ã¯ã·ã§ã³ã§ãé¸æé¨åãããã³ããã¨ã㦠LLM ã«æããããæ©è½ã ã¨èããã°è¯ãã§ããããâï¸ Continue writingï¼æç« ã®ç¶ç¶ï¼
é¸æããããã¹ãã®ç¶ããæ¸ãã¾ããé¸æé¨åããªã©ã¤ãããããããç®æ¡æ¸ãããæç« ãæ¸ãèµ·ããã®ã«ãå©ç¨ã§ãã¾ããð Summarizeï¼è¦ç´ä½æï¼
æç« ã®ä¸»è¦ãªãã¤ã³ããæ½åºããè¦ç´ãä½æãã¾ããé·ãè«æãå ±åæ¸ãææ©ãç解ãããå ´åã«ä¾¿å©ã§ããð Fix spelling and grammarï¼ææ³ä¿®æ£ï¼
ã¹ãã«ã¨ææ³ã®ãã§ãã¯ãè¡ããä¿®æ£æ¡ãæ示ãã¾ããåãªã誤åè±åã®ææã ãã§ãªããããèªç¶ãªè¡¨ç¾ã¸ã®æ¹åææ¡ãè¡ãã¾ãã
â» è±èªã§ã®å©ç¨ãæ³å®ãã¦ãããæ¥æ¬èªã§ã¯æ£ç¢ºãªçµæãå¾ããã¾ãããâ Find action itemsï¼ã¿ã¹ã¯æ½åºï¼
ããã¹ãããã¿ã¹ã¯ãæ½åºãããã§ãã¯ããã¯ã¹å½¢å¼ã§æ´çãã¾ããä¼è°ãã¼ããããã¸ã§ã¯ãææ¸ãããã¢ã¯ã·ã§ã³ã¢ã¤ãã ãå¹ççã«è¦ã¤ãåºãã®ã«å½¹ç«ã¡ã¾ããð§ New System Promptï¼ããã³ããä½æï¼
ã«ã¹ã¿ã ããã³ãããä½æããAIã®åä½ãã«ã¹ã¿ãã¤ãºã§ãã¾ããç¹å®ã®ç®çãè¦ä»¶ã«å¿ãã¦ãAIã®å¿çæ¹æ³ã調æ´ãããå ´åã«ä½¿ç¨ãã¾ãã
ã«ã¹ã¿ã ã¢ã¯ã·ã§ã³
Local GPTã®æ©è½ã¯ãã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ã追å ãããã¨ã§æ¡å¼µã§ãã¾ãã
ä¾ã¨ãã¦ãè±èªã«ç¿»è¨³ããã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ã®ç»é²æ¹æ³ã説æãã¾ãã
Local GPT ã®è¨å®ãéãã¦ãAdd new manually ãã¯ãªãã¯ãã¾ãã
Action name ã«ãè±èªã«ç¿»è¨³ããPrompt ã«ä»¥ä¸ãè¨å ¥ãã¾ãã
Output only the result, without any explanation. Translate into English.
Save ãã¯ãªãã¯ããã°ãã³ã³ããã¹ãã¡ãã¥ã¼ã«è¿½å ããã¾ãã
â» ããã³ããã¯æ¥æ¬èªã§æ¸ãã¦ãæ§ãã¾ããããã®ä¾ã§ã¯çµæãè±èªã§åºåããããããæ¥æ¬èªã«å¼ãããããªãããã«è±èªã§æ¸ãã¾ãããéã«ãæ¥æ¬èªã«ç¿»è¨³ããå ´åã¯ãæ¥æ¬èªã§ããã³ãããæ¸ãã¦ãåé¡ãªãã§ãããã
ã¡ãã¥ã¼å ã®ä½ç½®ãå¤ããã«ã¯ãè¨å®ã®æå¾ã®æ¹ã«ãã Change order ã使ç¨ãã¾ãã
ã³ã³ããã¹ãçæã®ä»çµã¿
Local GPT ã¯ãé¸æç¯å²ã®æç¡ã«ãã£ã¦æåãå¤ããã¾ãã
é¸æç¯å²ãããå ´åï¼é¸æãããããã¹ãç¯å²ãã³ã³ããã¹ãï¼æèï¼ã¨ã㦠LLM ã«æ¸¡ããã¾ããé¸æç¯å²å
ã«å«ã¾ãã [[ãªã³ã¯]]
ã RAG æ©è½ï¼å¾è¿°ï¼ã«ãã£ã¦åç
§ããã追å ã®ã³ã³ããã¹ãã¨ãã¦å©ç¨ããã¾ããããã«ãããç¦ç¹ãçµã£ãç確ãªå¿çãå¾ããã¨ãã§ããçãç¯å²ã®è©³ç´°ãªåæããç¹å®ã®ã»ã¯ã·ã§ã³ã«é¢ãã質åã«é©ãã¦ãã¾ãã
é¸æç¯å²ããªãå ´åï¼ç¾å¨éãã¦ãããã¡ã¤ã«å
¨ä½ãåæ対象ã¨ãªãã¾ãããã¡ã¤ã«å
ã®ãã¹ã¦ã® [[ãªã³ã¯]]
ã RAG æ©è½ã«ãã£ã¦åæãããã³ã³ããã¹ãã¨ãã¦å©ç¨ããã¾ããããã«ãããããåºãç¯å²ã®æ
å ±ãèæ
®ããå
æ¬çãªå¿çãå¾ããã¾ããææ¸å
¨ä½ã®è¦ç´ããåºãæèãå¿
è¦ã¨ãã質åã«é©ãã¦ãã¾ãããå¦çæéãé·ããªãå¯è½æ§ãããã¾ãã
RAG æ©è½
RAGï¼Retrieval-Augmented Generationï¼ã¯ãLLMã®å¿ççææã«ãã¼ã¿ãã¼ã¹ããé¢é£æ å ±ãåãåºãã¦åç §ããä»çµã¿ã§ããä¾ãã°ãç«ã®ååã¯ï¼ãã¨ãã質åã«å¯¾ãã¦ããã¼ã¿ãã¼ã¹ãããã¿ããã¨ããæ å ±ãæ¤ç´¢ãã¦åçã«æ´»ç¨ãã¾ãã
Local GPTã§ã¯ãMarkdownãã¡ã¤ã«å
ã® [[ãªã³ã¯]]
ã§åç
§ãããææ¸ããã¼ã¿ãã¼ã¹ã¨ãã¦æ©è½ãã質åã«é¢é£ããæ
å ±ãèªåçã«æ¤ç´¢ãã¦åçã«æ´»ç¨ãã¾ãã
â» æç« ã¯ãã¯ãã«ã«å¤æããããã¼ã¿ãã¼ã¹ã«ä¿åããã¾ããå¤æããã¯ãã«åãæ¤ç´¢ããã¯ãã«æ¤ç´¢ã¨å¼ã³ã¾ãã
ä¾ã示ãã¾ãã
ç«ã®ååã¯ï¼ [[ãã¼ã¿]]
ãã®ããã¹ããé¸æãã¦ã¢ã¯ã·ã§ã³ãæ示ããã°ãåç §å ã®ããã¼ã¿ããã¡ã¤ã«ãåç §ãã¦ãç«ã®ååãæ¸ããã¦ããï¼ã¨ãã¯ãã«æ¤ç´¢ã«ããå¤æãããï¼ç®æãã³ã³ããã¹ãã¨ã㦠LLM ã«æ¸¡ããã¾ããããã«ãããå¥ãã¡ã¤ã«ã«æ¸ããã¦ããç«ã®ååãåçãããã¨ãã§ãã¾ãã
RAG æ©è½ã®ããã©ã¼ãã³ã¹ãæé©åããããã«ãå¹æçãªãã£ãã·ã¥æ©è½ï¼ãã¯ãã« DBï¼ãåãã¦ãã¾ãããªã³ã¯å ã®ææ¸ã¯èªåçã«ãã¯ãã«åãããä¸åº¦å¦çããææ¸ã¯2åç®ä»¥éã®å¦çãé«éåããã¾ããææ¸ãæ´æ°ãããå ´åã¯èªåçã«ãã£ãã·ã¥ãæ´æ°ããã¾ãã
â» åãè¾¼ã¿ã¢ãã«ãæå®ããã¦ããªããã°ãRAG æ©è½ã¯å©ç¨ã§ããªãããããªã³ã¯ã«ãã追å ã®ã³ã³ããã¹ãã¯çæããã¾ããã
ã³ã³ããã¹ãã¦ã£ã³ãã¦ã®ç®¡ç
ã¢ãã«ãã³ã³ããã¹ããå¦çããããã®ã¯ã¼ã¯ã¨ãªã¢ãã³ã³ããã¹ãã¦ã£ã³ãã¦ã¨å¼ã³ã¾ãã
Local GPT ã¯ã³ã³ããã¹ãã¦ã£ã³ãã¦ã®ãµã¤ãºãåçã«èª¿æ´ãã¾ãã4,096 ãã¼ã¯ã³ãè¶ ããã¨èªåçã«ã³ã³ããã¹ãã¦ã£ã³ãã¦ãæ¡å¼µãããã®éã«ã¢ãã«ã®ãªãã¼ããçºçãã¾ããæ¡å¼µå¾ã«å®è¡ããã¢ã¯ã·ã§ã³ããã³ã³ããã¹ãã¦ã£ã³ãã¦ã® 1/4 以ä¸ã«åã¾ãå ´åã¯ç¸®å°ããããã®æããªãã¼ããçºçãã¾ãã
ã³ã³ããã¹ãã¦ã£ã³ãã¦ã®æ¡å¼µã¯ã¡ã¢ãªä½¿ç¨éãå¢å¤§ãããããããã®ããã«æ¡å¼µã¯ä¸æçãªå¦çã¨ãã¦è¨è¨ããã¦ãã¾ããã³ã³ããã¹ãã¦ã£ã³ãã¦ã®ãµã¤ãºãé »ç¹ã«å¤åãããããªæä½ãè¡ãã¨ããªãã¼ãã®ãªã¼ãã¼ãããã大ãããªããã注æãå¿ è¦ã§ãã
å¹æçãªæ´»ç¨æ¹æ³
ç¹å®ã®æ®µè½ãã»ã¯ã·ã§ã³ã«é¢é£ããå¿çã欲ããå ´åã¯ããã®é¨åãé¸æãã¦å®è¡ãããã¨ã§ãç¦ç¹ãçµã£ãå¿çãå¾ããã¨ãã§ãã¾ããææ¸å ¨ä½ã®æèãè¸ã¾ããå¿çã欲ããå ´åã¯é¸æããã«å®è¡ãã¾ãããææ¸ãµã¤ãºã«ãã£ã¦ã¯ã³ã³ããã¹ãã®æ¡å¼µãè¡ããããããæéãæããã¾ãã
éè¦ãªåèæ
å ±ã¯ [[ãªã³ã¯]]
ã§æ示çã«åç
§ãããã¨ã§ãããé¢é£æ§ã®é«ãå¿çãå¾ããã¨ãã§ãã¾ããPDFãã¡ã¤ã«ã¸ã®ãªã³ã¯ãåæ§ã«æ©è½ãããããè«æãå ±åæ¸ã®åç
§ãå¯è½ã¨ãªã£ã¦ãã¾ãã
æè¡çèæ¯
â» ãã®ã»ã¯ã·ã§ã³ã¯ä½è ã®èª¬æã«åºã¥ãã¾ãã
å¤ãã®ãã¼ã«ã« LLM ã¯å ¬ç§°ã®ã³ã³ããã¹ãã¦ã£ã³ãã¦ã®ãµã¤ãºã«é¢ããããå®è³ªçã«ã¯ 8,192 ãã¼ã¯ã³ç¨åº¦ã¾ã§ããå¹æçã«å¦çã§ããªãã¨ããå¶ç´ãããã¾ãã大éã®ææ¸ãã³ã³ããã¹ãã¨ãã¦ä¸ãããã¨ã¯ãããã£ã¦å¿çã®è³ªãä½ä¸ãããå¯è½æ§ãããã¾ãã
ãã®å¶ç´ã«å¯¾å¿ãããããLocal GPT ã¯æ示çãªãªã³ã¯ã®ã¿ãåç §ããè¨è¨ãæ¡ç¨ãã¦ãã¾ããããã«ãããé¢é£æ§ã®é«ãæ å ±ã«ç¦ç¹ãå½ã¦ãé¸æçãªã³ã³ããã¹ãåéã«ãã£ã¦ãã¼ã¯ã³æ°ãå¹ççã«ä½¿ç¨ãã¾ããLocal GPTã®è¨è¨ææ³ã¯ãããå¤ãã®ã³ã³ããã¹ããã§ã¯ãªããããé©åãªã³ã³ããã¹ãããéè¦ãããã¨ã«ããã¾ãã
ãã®è¨è¨ã¯ãã¦ã¼ã¶ã¼ã®ä½¿ç¨ä½é¨ã«å½±é¿ãä¸ãã¾ãã[[ãªã³ã¯]]
ã®ä½¿ç¨ã¯æ確ãªæå³ã®è¡¨æã¨ãªããåç
§æ
å ±ãæ示çã«æå®ã§ãã¾ããã¾ããé¸æç¯å²ã®æå®ã«ãããå¿
è¦ãªæ
å ±ã®ã¿ãå¦çãããã¨ã§ãå
¨ä½çãªå¦çé度ãåä¸ãã¾ãã