Skip to content
/ nats-llm Public

This cli tool makes Ollama or Gemini LLMs accessible via MATS microservices. Requests sent to this NATS microservice are forwarded to the corresponding LLM.

License

Notifications You must be signed in to change notification settings

hofer/nats-llm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏁 NATS to LLM proxy/router

workflow

This cli tool makes Ollama or Gemini LLMs accessible via NATS microservices. Requests sent to this NATS microservice are forwarded to the corresponding LLM.

Warning

🚨 🚧 This tool is under active development 🚧 🚨

This tool is very much work in progress. Expect almost daily breaking changes...

Run the following command to start an Ollama proxy:

./nats-llm proxy ollama --url="nats://localhost:4222"

Please check the the examples folder to see how a client can access an LLM exposed via NATS.

Testing

Use the following command to manually send messages to this service:

# Generate Text
nats req --reply-timeout=10s ollama.generate '{"model": "gemma2:2b", "prompt": "What is atorvastatin? Respond in one sentence."}'

# Create an embedding:
nats req --reply-timeout=10s ollama.embed '{"model": "snowflake-arctic-embed2", "input": "What is atorvastatin? Respond in one sentence."}'

Limitation: nats does have a size limit for payload.

Nats cli commands

Given the nats-llm-router is based on Nats Mirco, the following commands are useful:

List services:

nats micro ls

List service info:

nats micro info NatsOllama

About

This cli tool makes Ollama or Gemini LLMs accessible via MATS microservices. Requests sent to this NATS microservice are forwarded to the corresponding LLM.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •