Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ codescanai --provider custom --host http://localhost --port 5000 --token your_to
Using locally running [Ollama](https://github.com/ollama/ollama):

```bash
codescanai --provider custom --model llama3 --host http://localhost --port 11434 --endpoint /api/generate --directory path/to/code
codescanai --provider custom --model llama3 --host http://localhost --port 11434 --endpoint /v1 --directory path/to/code
```

### Supported arguments
Expand Down
5 changes: 3 additions & 2 deletions core/code_scanner/agent_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def __init__(self, args) -> None:
if args.endpoint:
host_url += args.endpoint
os.environ["OPENAI_BASE_URL"] = host_url
if args.token:
os.environ["OPENAI_API_KEY"] = args.token
# The OpenAI SDK requires a non-empty API key even for local servers that
# don't authenticate. Fall back to a dummy value when no token is supplied.
os.environ["OPENAI_API_KEY"] = args.token if args.token else "dummy"

self.agent = create_agent(
model_str=model_str,
Expand Down
Loading