Skip to content

shaolang/rusty-ai-engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty Common Sense Guide to AI Engineering

Rust implementations of the book A Common Sense Guide to AI Engineering published by Pragmatic Programmers.

All examples expect the OPENAI_API_KEY to be exported as an environment variable, e.g.,

$ OPENAI_API_KEY=<api-key> cargo run -p hello-world -- ...

As this repo uses Cargo workspace to organize the demonstrates, each demo's source directory name has the book's chapter prefix, e.g., 01-hello-world is the demo from chapter 1. However, when running the demo, drop the chapter prefix when the package -p (as shown above).

Ports by Chapter

Notable Differences

Other than the language and the libraries used, this port:

  • Uses embedded LanceDB instead of Pinecone for simplicity, i.e., no need to sign up Pinecone; also uses fastembed for text embedding.
  • Supports interfacing with local LLM servers, such as LM Studio and Ollama.

Wheel-equivalent (almost) Crates

The following table shows the crates used in place of the wheels:

Wheel Crate Remarks
Docling Transmutation Augmented with reqwest to retrieve resources from the web
openai async-openai
- lancedb Replaced Pinecone as vector database
- fastembed Generate text embeddings when populating vector database

As LanceDB uses ProtoBuf, you may need to install protobuf using Homebrew:

brew install protobuf

Or using asdf-vm:

asdf plugin add protoc https://github.com/paxosglobal/asdf-protoc.git

Resources

For convenience, all the files in resources directory are copied from the book's source code; the copyright of those files belong to the book's author and the publisher.

About

Rust implementations of examples from a PragProg book

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages