A command-line interface for getting weather information with natural language processing powered by Ollama and Phi-4 LLM.
- Natural language queries for weather information
- AI-powered weather descriptions
- Detailed weather data including:
- Temperature and "feels like" temperature
- Weather conditions
- Wind speed, direction, and gusts
- Humidity and pressure
- Visibility and cloud cover
- UV index
- Precipitation chance
- Clean, formatted terminal output
- Go 1.21 or higher
- Latest Ollama installed and running
- The phi-4 llm installed via Ollama
- Clone the repository:
git clone https://github.com/danielmerja/ollama-phi4-weather
cd ollama-phi4-weather
- Install dependencies:
go mod download
- Copy the example environment file:
cp .env.example .env
-
Update the .env file with your settings
-
Install the phi model in Ollama:
ollama run phi4
- Start the Ollama server:
ollama serve
- Run the CLI:
go run main.go
- Ask about the weather using natural language:
> What's the weather like in Miami?
> Is it raining in Seattle right now?
> How's the temperature in New York City?
- Type 'quit' to exit
API_KEY
: Your API key for authenticationRATE_LIMIT
: Rate limit for requests (default: 1)PORT
: Server port (default: 8080)OLLAMA_URL
: Ollama API URL (default: http://localhost:11434/api)OLLAMA_MODEL
: Ollama model to use (default: phi4)
MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.