Add model selection and local RAG

This commit is contained in:
seo-amugae committed 2026-08-09 19:57:23 +09:00
1 parent 2b2e5fcb0f
commit bf39c2e070
6 files changed
+369 -32

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
from __future__ import annotations
import time
import ollama
MODELS = ["qwen2.5:7b", "llama3.1:8b", "qwen2.5:14b"]
PROMPT = (
"Answer in Korean in exactly three bullets. Compare your usefulness for "
"local coding assistance, Korean Q&A, and careful reasoning."
)
def main() -> None:
for model in MODELS:
started = time.perf_counter()
try:
response = ollama.chat(
model=model,
messages=[
{"role": "system", "content": "Be concise and practical."},
{"role": "user", "content": PROMPT},
],
)
elapsed = time.perf_counter() - started
text = response["message"]["content"].strip().replace("\n", " ")
print(f"{model}\t{elapsed:.1f}s\t{text[:180]}")
except Exception as exc:
elapsed = time.perf_counter() - started
print(f"{model}\t{elapsed:.1f}s\tERROR: {exc}")
if __name__ == "__main__":
main()