Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

ローカルLLM環境を構築できるOllamaをためす その1:Dockerで環境構築(CPU動作)

実際のところ

とりあえず手元のノートPCで試すのでCPUオンリーの構成で

$ docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

これで
http://localhost:11434/
にアクセスすると、動作してる旨の通知がでてる事がわかります

Dockerコンテナのターミナルを開き……とりあえず、定番であるMeta社のllama3の環境導入を行います
4.7GByteもあるので注意

$ ollama run llama3

ためす

環境が構築されてみると、こんな感じで対話を促してくるので、ちょっとやってみましょう

>>> Send a message (/? for help)
>>> How about you?
I'm just an AI, I don't have feelings or personal experiences like humans do. My purpose is to assist and provide
helpful information to those who interact with me. When our conversation ends, I'll simply cease to be active
until someone else starts a new conversation or task. So, no need to worry about me!

gdgdな英語文面ですら、文意を汲み取って聞いてもないレベルで応えてくれます。
僕と違ってカシコイデスネ

>>> Please explain me about Japanese ramen?
Japanese ramen! It's a national treasure and a beloved dish around the world.

Ramen is a popular Japanese noodle soup made from pork or chicken broth, wheat noodles, and various toppings. The
dish originated in China, but Japan has its own unique twist on this culinary classic.

Here are some key aspects of Japanese ramen:

1. **Broth**: Ramen broth is typically rich and flavorful, with a clear or creamy texture. There are four main
types:
        * Tonkotsu (): Pork bone broth, often creamy and milky.
        * Shoyu (): Chicken or pork stock mixed with soy sauce for a savory flavor.
        * Shio (): Salt-based broth, often used in combination with other ingredients.
        * Miso (): A combination of tonkotsu and shoyu broths, giving it a rich and savory flavor.
2. **Noodles**: Ramen noodles are typically made from wheat flour, water, and salt. They're thin, straight, and
slightly chewy. Some popular noodle styles include:
        * Hakata-style (): Thin, curly noodles from Fukuoka.
        * Sapporo-style (): Thick, straight noodles from Hokkaido.
3. **Toppings**: The variety of toppings is what sets Japanese ramen apart. You might find:
        * Chashu (): Braised pork belly, often sliced into thin strips.
        * Ajitama (): Boiled egg, sometimes marinated in soy sauce or sake.
        * Menma (): Bamboo shoots, adding a sweet and earthy flavor.
        * Negi (): Thinly sliced green onions, for added freshness.
4. **Regional variations**: Ramen is enjoyed throughout Japan, with different regions offering unique variations:
        * Hokkaido: Known for its rich miso-based broths and thick noodles.
        * Kyushu: Famous for its tonkotsu broths and thin, curly noodles (Hakata-style).
        * Tokyo: Offers a diverse range of ramen styles, from classic to modern.
5. **Cultural significance**: Ramen has become an integral part of Japanese culture, with many shops offering a
unique dining experience:
        * Ramen shops often have a cozy atmosphere and communal seating.
        * Some shops offer a "full-course" meal, including rice, miso soup, and pickles.
        * Ramen is a popular comfort food, especially during winter or as a late-night snack.

Now that you know more about Japanese ramen, I hope you're craving a steaming hot bowl!