0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DeepWiki-OpenとOllamaでgithubからWikiを作る

Last updated at Posted at 2025-05-17

はじめに

DeepWiki-Openは、GitHubリポジトリの内容を自動で解析し、Wiki形式のドキュメントを生成するDeepWikiのOSS版です。プライベートリポジトリやGitLabのリポジトリも扱う事ができ、日本語で作成することもできます。

セットアップ

公式の docker-compose.yml を少し変更して、 Ollamaが同時に立ち上がる様にします。また、embedding modelにmulti-lingual対応のものを使いたいので、 api/config/embedder.json をローカルにコピーして修正し、docker内でこれを参照する様にします。

  • docker-compose.yml

    services:
      deepwiki:
        image: ghcr.io/asyncfuncai/deepwiki-open:latest
        container_name: deepwiki
        network_mode: host
        ports:
          - "${PORT:-8001}:${PORT:-8001}"  # API port
          - "3000:3000"  # Next.js port
        environment:
          - PORT=${PORT:-8001}
          - NODE_ENV=production
          - SERVER_BASE_URL=http://localhost:${PORT:-8001}
        volumes:
          - $HOME/.adalflow:/root/.adalflow  # Persist repository and embedding data
          - ./embedder.json:/app/api/config/embedder.json
    
      ollama:
        image: ollama/ollama:latest
        volumes:
          - $HOME/.ollama/.ollama:/root/.ollama
        ports:
          - "11434:11434"
        deploy:
          resources:
            reservations:
              devices:
                - driver: nvidia
                  count: all
                  capabilities: [gpu]
    
  • embedder.json

    {
      "embedder": {
        "client_class": "OpenAIClient",
        "batch_size": 500,
        "model_kwargs": {
          "model": "text-embedding-3-small",
          "dimensions": 256,
          "encoding_format": "float"
        }
      },
      "embedder_ollama": {
        "client_class": "OllamaClient",
        "model_kwargs": {
          "model": "bge-m3"  // ここを変更
        }
      },
      "retriever": {
        "top_k": 20
      },
      "text_splitter": {
        "split_by": "word",
        "chunk_size": 350,
        "chunk_overlap": 100
      }
    }
    

実行

docker compose up -d で立ち上げたら、 http://localhost:3000 にアクセスします。

deepwiki_01

右上の「Wikiを生成」を押すと設定画面になります。

deepwiki_02

「モデルプロバイダー」を 「Ollama(ローカル)」 にして、 「モデル選択」からモデルを選択します。2025/5時点ではqwen3:1.7b, llama3:8b, qwen3:8b からの選択になっていますが、「カスタムモデルを使用」をオンにすると、(Ollamaで使える)任意のモデルを設定することができるようになります。
「Wikiを生成」を推すと生成が始まり、以下の様な表示になるので、出来上がるのを待ちます。

deepwiki_03

Wikiが完成すると、それが表示されます。

deepwiki_04

Markdownでエクスポートしたり、右下の吹き出しから質問したりもできます。

deepwiki_05

まとめ

DeepWiki-OpenでgithubからWikiを作成してみました。本家と異なり、日本語で作成できるのがありがたいです。今回は敢えてローカルLLMを使いましたが、LLMにOpenAIやGeminiを使うとより良いものが作れるのかもしれません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?