-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump version, fix support for running chidori applications headlessly…
…, include docker example
- Loading branch information
Showing
38 changed files
with
329 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Deployment Examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Initalling chidori | ||
FROM ghcr.io/rust-lang/rust:nightly-bookworm | ||
|
||
RUN apt update | ||
RUN apt install -y cmake curl | ||
RUN apt install -y python3-dev | ||
|
||
RUN curl -LsSf https://astral.sh/uv/install.sh | sh | ||
RUN cargo +nightly install chidori-core --locked | ||
RUN uv venv | ||
RUN uv pip install "litellm[proxy]" | ||
|
||
WORKDIR /usr/src | ||
RUN mkdir logs | ||
COPY example_agent ./example_agent | ||
COPY init.sh ./init.sh | ||
COPY litellm_config.yaml litellm_config.yaml | ||
RUN chmod +x ./init.sh | ||
|
||
ENV OPENAI_API_KEY=OPENAI_API_KEY | ||
ENV ANTHROPIC_API_KEY=ANTHROPIC_API_KEY | ||
EXPOSE 8000 | ||
|
||
CMD ["./init.sh"] | ||
|
||
|
||
|
||
# Bundle Stage | ||
#FROM scratch | ||
#COPY --from=builder /usr/local/cargo/bin/chidori-core . | ||
#COPY agent ./example_agent | ||
#COPY init.sh ./init.sh | ||
#RUN ["./init.sh"] | ||
#USER 1000 | ||
#CMD ["./deciduously-com", "-a", "0.0.0.0", "-p", "8080"] |
48 changes: 48 additions & 0 deletions
48
deployment/docker-single-container/example_agent/example.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Demonstrating running a hono web service to produce a user facing interface | ||
|
||
|
||
```python | ||
def testingFunC(x): | ||
return x + "Hello" | ||
``` | ||
|
||
```javascript | ||
import { Hono } from 'https://deno.land/x/hono/mod.ts'; | ||
import { serve } from 'https://deno.land/[email protected]/http/server.ts'; | ||
|
||
const app = new Hono(); | ||
|
||
app.get('/', (c) => { | ||
const form = ` | ||
<h1>Welcome to Trip Planner Crew</h1> | ||
<form action="/submit" method="post"> | ||
<label>From where will you be traveling from?</label><br> | ||
<input type="text" name="origin"><br> | ||
<label>What are the cities options you are interested in visiting?</label><br> | ||
<input type="text" name="cities"><br> | ||
<label>What is the date range you are interested in traveling?</label><br> | ||
<input type="text" name="date_range"><br> | ||
<label>What are some of your high level interests and hobbies?</label><br> | ||
<input type="text" name="interests"><br> | ||
<button type="submit">Submit</button> | ||
</form> | ||
`; | ||
return c.html(form); | ||
}); | ||
|
||
app.post('/submit', async (c) => { | ||
const body = await c.req.parseBody(); | ||
const { origin, cities, date_range, interests } = body; | ||
const xx = await testingFunC(origin); | ||
const response = ` | ||
<h2>Trip Details</h2> | ||
<p><strong>Origin:</strong> ${xx}</p> | ||
<p><strong>Cities:</strong> ${cities}</p> | ||
<p><strong>Date Range:</strong> ${date_range}</p> | ||
<p><strong>Interests:</strong> ${interests}</p> | ||
`; | ||
return c.html(response); | ||
}); | ||
|
||
serve(app.fetch); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Create log files for LiteLLM | ||
mkdir -p logs | ||
|
||
# Start LiteLLM and redirect both stdout and stderr to log files | ||
uv run litellm --config ./litellm_config.yaml 2>&1 & | ||
LITELLM_PID=$! | ||
|
||
# Start Chidori and stream its output to console while still maintaining the background process | ||
chidori-core run --load ./example_agent 2>&1 & | ||
CHIDORI_PID=$! | ||
|
||
# Optional: Print PIDs for debugging | ||
echo "LiteLLM PID: $LITELLM_PID" | ||
echo "Chidori PID: $CHIDORI_PID" | ||
|
||
# Wait for any process to exit | ||
wait -n | ||
|
||
# Capture the exit status | ||
EXIT_STATUS=$? | ||
|
||
# Optional: Print which process exited | ||
if ! kill -0 $LITELLM_PID 2>/dev/null; then | ||
echo "LiteLLM process exited first with status $EXIT_STATUS" | ||
elif ! kill -0 $CHIDORI_PID 2>/dev/null; then | ||
echo "Chidori process exited first with status $EXIT_STATUS" | ||
fi | ||
|
||
# Clean up any remaining processes | ||
kill $LITELLM_PID $CHIDORI_PID 2>/dev/null | ||
|
||
# Exit with status of process that exited first | ||
exit $EXIT_STATUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
model_list: | ||
- model_name: o1-preview | ||
litellm_params: | ||
model: openai/o1-preview | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: o1-mini | ||
litellm_params: | ||
model: openai/o1-mini | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: gpt-4o | ||
litellm_params: | ||
model: openai/gpt-4o | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: gpt-4o-mini | ||
litellm_params: | ||
model: openai/gpt-4o-mini | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: gpt-4-turbo | ||
litellm_params: | ||
model: openai/gpt-4-turbo | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: gpt-3.5-turbo | ||
litellm_params: | ||
model: openai/gpt-3.5-turbo | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: gpt-3.5-turbo-instruct | ||
litellm_params: | ||
model: text-completion-openai/gpt-3.5-turbo-instruct | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: text-embedding-3-small | ||
litellm_params: | ||
model: openai/text-embedding-3-small | ||
api_key: os.environ/OPENAI_API_KEY | ||
- model_name: claude-3.5 | ||
litellm_params: | ||
model: anthropic/claude-3-5-sonnet-20240620 | ||
api_key: os.environ/ANTHROPIC_API_KEY | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ members = [ | |
resolver = "2" | ||
|
||
[workspace.package] | ||
version = "0.2.8" | ||
version = "0.2.9" | ||
authors = ["Colton Pierson <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
use std::path::Path; | ||
use chidori_core::sdk::chidori::Chidori; | ||
use chidori_core::sdk::entry::PlaybackState; | ||
|
||
fn main() { | ||
let current_file = env!("CARGO_MANIFEST_DIR"); | ||
let current_file_path = Path::new(current_file); | ||
let relative_path = current_file_path.join("./"); | ||
let mut env = Chidori::new(); | ||
env.load_md_directory(&relative_path); | ||
let mut s = env.get_instance().unwrap(); | ||
s.run(); | ||
s.run(PlaybackState::Paused); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.