Rust Ollama By Examples - 4 Chapters (Full Tutorial - Rust AI)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 มิ.ย. 2024
  • Here is a complete Rust programming tutorial on interfacing with the Ollama HTTP API using the ollama-rs library. Part of the Rust AI Programming series ( • Rust AI Programming Se... )
    IMPORTANT ollama-rs 0.1.6 introduced a breaking change (from 0.1.6_ where stream.next() now returns a Result Vec GenerationResponse instead of a single GenerationResponse. The fix is straightforward. It has been implemented in the main branch and tagged as E01-01 ( github.com/jeremychone-channe... )
    GitHub: github.com/jeremychone-channe...
    Discord: / discord
    Rust10x VSCode Extension: rust10x.com/vscode
    - 00:00:00 - Intro
    - 00:01:10 - Setup
    - 00:06:48 - C01 - Generation
    - 00:17:46 - C02 - With Context
    - 00:31:29 - C03 - Chat
    - 00:42:28 - C04 - Embeddings
    == Jeremy Chone:
    - Patreon - / jeremychone - Any help is a big help (for Rust educational content)
    - Twitter - / jeremychone
    - Discord general-rust - / discord
    - Discord rust10x - / discord
    - Rust10x - rust10x.com - Rust resources for production coding.
    == Rust10x AI / OpenAI / Ollama
    - Rust OpenAI API Tutorial: • Learn Rust OpenAI API ...
    - Rust Ollama Tutorial (this video): • Rust Ollama By Example...
    == Rust10x Web App production coding:
    Episode 01: • Rust Axum Production C...
    Episode 02: • Rust Sea-Query + SQLX ...
    Episode 03: • Rust Workspace Product...
    Episode 04: • Rust Argon 2 Password ...
    Episode 05.1: • Rust RPC Router - Axum...
    Web Site: rust10x.com/web-app
    GitHub: github.com/rust10x/rust-web-app
    Discord rust10x - / discord
    Patreon - / jeremychone - Any help is a big help (for Rust Production Coding educational content)
    == Other
    Big thanks to CrabNebula (crabnebula.dev/) for sponsoring this video.
    Other popular Rust Programming videos:
    - Rust Web App Production Coding Blueprint - • Rust Axum Production C...
    - Rust Axum - Full Course - • Rust Axum Full Course ...
    - Rust Type State Builder Pattern - • Rust Programming: Type...
    - Quick Start Code Layout - • Rust - Simple Code Lay...
    - AWESOME-APP Full Overview - Rust template for building Awesome Desktop Application: • Building Awesome Deskt...
    - Tauri Quick Introduction (Desktop App wit Rust Programming): • Rust Tauri 1.0 - Quick...
    - Rust Web App tutorials series: • Rust Web App - 1/3 - D...
    - Rust Bevy Full Tutorial - Game Development with Rust: • Rust Bevy Full Tutoria...
    - Rust for Java Developers series: • Rust for Java Develope...
    Playlists:
    - Rust Web App Production Coding Series: • Rust Production Coding...
    - Rust For Desktop App: • Rust Programming for D...
    - Everything Rust Programming - Tutorials, Courses, Tips, Examples: • Everything Rust Progra...
    - Rust Programming for Web Development: • Rust Programming for W...
    - Rust Courses: • Rust Course 2021 by th...
    - Rust for Java Developers: • Rust for Java Developers
    Rust10x - Coding Resources for Production Coding in Rust. ➜ rust10x.com
    Other notes:
    - ScreenBrush for the green lines. (Gromit seems to be the equivalent on Linux)
    - Sketchapp for some graphics.
    - Davinci Resolve and Fusion video editing.
    - VSCode with Google Material icon themes (with some customization)
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 29

  • @JeremyChone
    @JeremyChone  4 หลายเดือนก่อน +6

    IMPORTANT ollama-rs 0.1.6 introduced a breaking change (from 0.1.5) where stream.next() now returns a Result instead of a single GenerationResponse. The fix is straightforward. It has been implemented in the main branch and tagged as E01-01 ( github.com/jeremychone-channel/rust-xp-ollama/tree/E01-01 )

  • @christerpherhunter930
    @christerpherhunter930 4 หลายเดือนก่อน +27

    Please do not stop producing these high quality videos!

  • @romanstingler435
    @romanstingler435 3 หลายเดือนก่อน +2

    "Wrong answer because we know Rust is the best one" YES I like that :)

  • @janiscakstins2846
    @janiscakstins2846 4 หลายเดือนก่อน +1

    This is one of the best Rust channels out there. Keep making these videos!

  • @mr.daniish
    @mr.daniish 3 หลายเดือนก่อน +1

    one of the top channels on the planet for rust and llms!

  • @MaxJM711
    @MaxJM711 4 หลายเดือนก่อน +2

    Your videos are incredible Jeremy! I decided as one of my main New Years resolution to properly learn Rust this year and your channel has been nothing short of a miracle for me. Thank you so much for everything bro!
    I am doing my thesis next year and I wanted to make it about ML + Cybersecurity. I was thinking about making it all in Python (of course lol), but I may eventually use Rust for this in case the tooling is ready for something like that

  • @prashlovessamosa
    @prashlovessamosa 4 หลายเดือนก่อน +4

    Hey Jeremy thanks for making awesome stuff for us.

  • @GlebEagle
    @GlebEagle 4 หลายเดือนก่อน +2

    WOW!!! That's very interesting topic! Thank you!

  • @design2dev
    @design2dev 4 หลายเดือนก่อน +3

    Absolutely adore your content! Could you whip up a dazzling video on grpc tonic? How about crafting a mesmerizing e-commerce backend with microservices? Picture this: a seamless connection between a user app and an admin app, all beautifully showcased in the same video. Heartfelt thanks for your incredible contributions to the Rust community!

    • @JeremyChone
      @JeremyChone  4 หลายเดือนก่อน +2

      Thanks for the kind words.
      On gRPC, I usually lean more towards json-rpc than grpc. I believe grpc serves its purpose in specific niches but has been overgeneralized.
      All the functionalities you described will work well with json-rpc too, offering increased versatility and virtually the same performance for those use cases.
      grpc becomes necessary when microsecond (not millisecond only) response times are needed, and when parsing speed is critical to the processing speed. For all other scenarios, json-rpc is more versatile that its overall value is higher for most use cases IMO, contrary to popular belief and momentum.
      Check out these videos:
      - Overview and insights: th-cam.com/video/Gc5Nj5LJe1U/w-d-xo.html
      - SQLBuilder / ModQL (related to json-rpc): th-cam.com/video/-dMH9UiwKqg/w-d-xo.html
      - Here's a mini high-level query spec I've developed for json-rpc: joql.org
      Now, if your team is really set on using grpc, then this might not be a discussion worth having, as grpc will get the job done, and with technologies like tonic and others, it could work ok.

    • @design2dev
      @design2dev 4 หลายเดือนก่อน +1

      Thanks a lot, will try to play with json-rpc.But for the front end part for the majority of frameworks , they do not have support for json-rpc currently than they have for grpc

  • @ItaloMaiaTM
    @ItaloMaiaTM 3 หลายเดือนก่อน

    Really nice video, much appreciated!

  • @ItaloMaiaTM
    @ItaloMaiaTM 3 หลายเดือนก่อน +1

    25:49 - Makefiles are also a nice option for that.

  • @maxali6591
    @maxali6591 4 หลายเดือนก่อน +1

    Continue to teach us. Great thank you!

  • @brianlogan4740
    @brianlogan4740 4 หลายเดือนก่อน +1

    Ah yes thank you! Exactly what I needed!

  • @HagbardCelineOnRust
    @HagbardCelineOnRust 4 หลายเดือนก่อน +1

    Thanks for the video. I liked and subscribed 😛

  • @sunitjoshi3573
    @sunitjoshi3573 4 หลายเดือนก่อน +1

    Thanks a lot for taking the time to put this out. Are you planning a Rust Web Dev course or a Learning Track? I would be very interested.

    • @JeremyChone
      @JeremyChone  4 หลายเดือนก่อน +1

      So there is couple of videos about web dev. The Rust full Axum course, and the Rust Web App production coding.

  • @zeroows
    @zeroows 4 หลายเดือนก่อน +1

    Thank you.

  • @mjcc_
    @mjcc_ 4 หลายเดือนก่อน +1

    Hey, great video Jeremy !
    Is it possible to make a video to how to create a plugin for obsidian with this rust-ollama project ?
    I think it can be a realy cool comunity project too 😉

  • @ItaloMaiaTM
    @ItaloMaiaTM 3 หลายเดือนก่อน +1

    == nevermind; saw your warning message; by the way, you could have used transpose to work around the api change. Why did you opt out of doing so? == At 15:16, `let res = res?;` worked here without the need to use map_err.
    Regardless, enjoying the video by buckets!
    I'm using llama2 model instead of the suggested one, so to save a bit in space. The docker Ollama docker container is working quite well too!
    Back to watching...

    • @JeremyChone
      @JeremyChone  3 หลายเดือนก่อน +1

      Ho, cool, you might be right, i will check the code.

    • @JeremyChone
      @JeremyChone  3 หลายเดือนก่อน +1

      Ok, yes, now we can use `let res_list = res?` without the `map_err`. It was leftover from ollam-rs `0.1.5` when it returned a single GenerationResponse and I think did not implement the standard output.
      I've updated the codebase.
      Also, I added a note because I think the handling of `Vec` might not be correct. It's a corner case, as the vector will mostly be of length 1, but it should still be fixed. I just need to understand what it means to have a vector length > 1.
      Here is the ticket I logged about the ollama-rs change: github.com/pepperoni21/ollama-rs/issues/20

  • @abobunus
    @abobunus 3 หลายเดือนก่อน

    Is there a way to make your own language model with Rust? Train it and then use it as you showed in this video.

  • @user-zv2hc3fz2x
    @user-zv2hc3fz2x 4 หลายเดือนก่อน

    너 잘하네 재능있어 열심히해🎉

  • @cthutu
    @cthutu 4 หลายเดือนก่อน

    You will need an nVidia GPU to make use of the GPU acceleration. AMD is CPU-only :(

    • @JeremyChone
      @JeremyChone  4 หลายเดือนก่อน

      Works ok on my Mac apple silicon.

    • @cthutu
      @cthutu 4 หลายเดือนก่อน +1

      @@JeremyChone Unfortunately, my Linux-based PC with an AMD GPU (which is the best for Linux games) is not supported :( It falls back to CPU.

  • @prashlovessamosa
    @prashlovessamosa 4 หลายเดือนก่อน +6

    Firsttt🎉 finally