Skip to content

Instantly share code, notes, and snippets.

@5shekel
Last active September 24, 2024 23:29
Show Gist options
  • Save 5shekel/40350c061038217b4f6f4b6c42ffa6ce to your computer and use it in GitHub Desktop.
Save 5shekel/40350c061038217b4f6f4b6c42ffa6ce to your computer and use it in GitHub Desktop.

how_to_quary_a_repo

goal is to pass a git repo to the LLM so it can consume and we can quary it.
we will use a cli tool called llm
and an auxiliry tool called files-to-prompt from same auther

install

install llm

pip install llm 
llm install llm-openrouter 
#auth, if you have $OPENAI_API_KEY in your enviroment, and want to use gpt you can use llm without setting keys
llm keys set openrouter #paste key when asked
llm models default claude-3.5-sonnet #or gpt-4o for openai

we will get llm.exe tool we can run in any terminal
llm "five names for a gaint pinguin baby"

install files-to-prompt

pip install files-to-prompt

run

note the pipe | symbol, it passes the output of one command to another.

git clone github.com/some/repo
files-to-prompt.exe .\repo\ | llm --system "in the code what port is used, and what address libcurl uses"

after inital push we should use the -c to --continue the conversation with prior knowledge

notes

  • if you have $OPENAI_API_KEY in your enviroment you can use llm without any mods.
  • to set gpt-4o as default, llm models default gpt-4o
  • You can view the current model by running this: llm models default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment